diff --git a/.ado/azure-pipelines.yml b/.ado/azure-pipelines.yml deleted file mode 100644 index d7bc027547..0000000000 --- a/.ado/azure-pipelines.yml +++ /dev/null @@ -1,204 +0,0 @@ -pr: - - main - -variables: - - template: variables/vars.yml - -jobs: - # Dedicated task to build JS code, including jest tests, snapshot testing, and linting, because these things can be super - # time consuming they don't need to run on every CI pass, instead do a dedicated JS loop to make the platform specific tests start quicker - - job: JSPR - displayName: JS PR - pool: - vmImage: 'ubuntu-latest' - timeoutInMinutes: 60 # how long to run the job before automatically cancelling - cancelTimeoutInMinutes: 5 # how much time to give 'run always even if cancelled tasks' before killing them - - steps: - - checkout: self - persistCredentials: true - - - template: templates/setup-repo.yml - - - script: | - yarn checkchange - displayName: 'check change' - - - script: | - yarn prettier - displayName: 'check prettier' - - - script: | - yarn lint-lockfile - displayName: 'run lint-lockfile' - - - script: | - yarn buildci - displayName: 'yarn buildci [test]' - - - script: | - yarn check-for-changed-files - displayName: 'verify API and Ensure Changed Files' - - - job: AndroidPR - displayName: Android PR - pool: - vmImage: 'macos-latest' - variables: - platform: 'android' - timeoutInMinutes: 60 # how long to run the job before automatically cancelling - cancelTimeoutInMinutes: 5 # how much time to give 'run always even if cancelled tasks' before killing them - - steps: - - checkout: self - persistCredentials: true - - # setup repo basics - - template: templates/setup-repo-min-build.yml - - # package android bundle - - script: | - yarn bundle:$(platform) - workingDirectory: apps/fluent-tester - displayName: 'yarn bundle $(platform)' - - # builds a debug apk and runs E2E tests on it - # Disable as Android E2E tests are failing - # - template: templates/e2e-testing-android.yml - - - job: macOSPR - displayName: macOS PR - pool: - vmImage: $(VmImageApple) - variables: - platform: 'macos' - timeoutInMinutes: 60 # how long to run the job before automatically cancelling - cancelTimeoutInMinutes: 5 # how much time to give 'run always even if cancelled tasks' before killing them - - steps: - - checkout: self - persistCredentials: true - - - template: templates/setup-repo-min-build.yml - - - template: templates/apple-tools-setup.yml - - - script: | - set -eox pipefail - yarn bundle:macos - workingDirectory: apps/fluent-tester - displayName: 'yarn bundle macos' - - - bash: | - set -eox pipefail - pod install --verbose - workingDirectory: apps/fluent-tester/macos - displayName: 'pod install' - - - task: CmdLine@2 - displayName: Build macOS - inputs: - script: | - set -eox pipefail - ./.ado/scripts/xcodebuild.sh apps/fluent-tester/macos/FluentTester.xcworkspace macosx ReactTestApp build - env: - CCACHE_DISABLE: 1 - - - template: templates/e2e-testing-macos.yml - - - job: iOSPR - displayName: iOS PR - pool: - vmImage: $(VmImageApple) - timeoutInMinutes: 60 # how long to run the job before automatically cancelling - cancelTimeoutInMinutes: 5 # how much time to give 'run always even if cancelled tasks' before killing them - - steps: - - checkout: self - persistCredentials: true - - - template: templates/setup-repo-min-build.yml - - - template: templates/apple-tools-setup.yml - - - script: | - set -eox pipefail - yarn bundle:ios - workingDirectory: apps/fluent-tester - displayName: 'yarn bundle ios' - - - bash: | - set -eox pipefail - pod install --verbose - workingDirectory: apps/fluent-tester/ios - displayName: 'pod install' - - - task: CmdLine@2 - displayName: Build iOS - inputs: - script: | - set -eox pipefail - ./.ado/scripts/xcodebuild.sh apps/fluent-tester/ios/FluentTester.xcworkspace iphonesimulator ReactTestApp build - env: - CCACHE_DISABLE: 1 - - # Disable iOS E2E tests as they fail on macOS-13 images - # - template: templates/e2e-testing-ios.yml - - # Windows bundling and end to end testing - - job: WindowsPR - displayName: Windows PR - pool: - name: rnw-pool-4 - demands: ImageOverride -equals rnw-img-vs2022-node22 - timeoutInMinutes: 60 # how long to run the job before automatically cancelling - cancelTimeoutInMinutes: 5 # how much time to give 'run always even if cancelled tasks' before killing them - - # The "displayName" of all steps that execute a command within our repo (such as 'yarn build') start lowercase to make it - # easier to differentiate in-repo scripts from environmental setup. This makes it easier to understand CI pipeline results. - steps: - - checkout: self - persistCredentials: true - fetchDepth: 5 - - # yarn and minimal build to get set up - - template: templates/setup-repo-min-build.yml - - # bundle windows adn do end to end tests - - template: templates/e2e-testing-uwp.yml - - # Win32 bundling and end to end testing - - job: Win32PR - displayName: Win32 PR - pool: - name: rnw-pool-4 - demands: ImageOverride -equals rnw-img-vs2022-node22 - timeoutInMinutes: 60 - cancelTimeoutInMinutes: 5 - - steps: - - checkout: self - persistCredentials: true - - # yarn and minimal build to get set up - - template: templates/setup-repo-min-build.yml - - # bundle win32 and do end to end tests - - template: templates/e2e-testing-win32.yml - - # Dedicated task to make sure link on repo are functional. - - job: TestLinks - displayName: Test repo links - pool: cxe-ubuntu-20-04-small - timeoutInMinutes: 60 # how long to run the job before automatically cancelling - cancelTimeoutInMinutes: 5 # how much time to give 'run always even if cancelled tasks' before killing them - - steps: - - checkout: self - persistCredentials: true - - - template: templates/setup-repo.yml - - - script: | - find . -name \*.md -not -name CHANGELOG.md -not -path '*/\node_modules/*' -print0 | xargs -0 -n1 yarn test-links -c `pwd`/.ado/markdown-link-check-config.json - displayName: 'testing links' diff --git a/.github/workflows/pr.yml b/.github/workflows/pr.yml new file mode 100644 index 0000000000..466aa41b82 --- /dev/null +++ b/.github/workflows/pr.yml @@ -0,0 +1,319 @@ +name: PR +on: pull_request + +permissions: + contents: read + +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + +jobs: + js: + name: JS PR + runs-on: ubuntu-latest + timeout-minutes: 60 + steps: + - name: Checkout + uses: actions/checkout@v4 + with: + fetch-depth: 0 + + - name: Set up toolchain + uses: microsoft/react-native-test-app/.github/actions/setup-toolchain@5.0.14 + with: + node-version: 22 + + - name: Install dependencies + run: yarn + + - name: Check change files + run: yarn checkchange + + - name: Check prettier + run: yarn prettier + + - name: Run lint-lockfile + run: yarn lint-lockfile + + - name: Build CI + run: yarn buildci + + - name: Verify API and ensure changed files + run: yarn check-for-changed-files + + android: + name: Android PR + runs-on: ubuntu-latest + timeout-minutes: 60 + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Set up toolchain + uses: microsoft/react-native-test-app/.github/actions/setup-toolchain@5.0.14 + with: + platform: android + node-version: 22 + + - name: Install dependencies + run: yarn + + - name: Build packages + run: yarn build + + - name: Bundle Android + run: yarn bundle:android + working-directory: apps/fluent-tester + + # Android E2E tests are currently disabled + # - name: Build Android APK + # ... + # - name: Run E2E Android tests + # ... + + macos: + name: macOS PR + runs-on: macos-latest + timeout-minutes: 60 + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Set up toolchain + uses: microsoft/react-native-test-app/.github/actions/setup-toolchain@5.0.14 + with: + platform: macos + node-version: 22 + xcode-developer-dir: /Applications/Xcode_16.4.app + + - name: Install dependencies + run: yarn + + - name: Build packages + run: yarn build + + - name: Bundle macOS + run: | + set -eox pipefail + yarn bundle:macos + working-directory: apps/fluent-tester + + - name: Pod install + run: | + set -eox pipefail + pod install --verbose + working-directory: apps/fluent-tester/macos + + - name: Build macOS app + run: | + set -eox pipefail + ./.ado/scripts/xcodebuild.sh apps/fluent-tester/macos/FluentTester.xcworkspace macosx ReactTestApp build + env: + CCACHE_DISABLE: 1 + + - name: Prepare E2E macOS tests + run: yarn e2eprep:macos + working-directory: apps/E2E + + - name: Run E2E macOS tests + run: yarn e2etest:macos + working-directory: apps/E2E + + - name: Upload E2E macOS artifacts + if: ${{ always() }} + uses: actions/upload-artifact@v4 + with: + name: E2E_macos_Dump + path: | + apps/E2E/reports + apps/E2E/errorShots + + ios: + name: iOS PR + runs-on: macos-latest + timeout-minutes: 60 + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Set up toolchain + uses: microsoft/react-native-test-app/.github/actions/setup-toolchain@5.0.14 + with: + platform: ios + node-version: 22 + xcode-developer-dir: /Applications/Xcode_16.4.app + + - name: Install dependencies + run: yarn + + - name: Build packages + run: yarn build + + - name: Bundle iOS + run: | + set -eox pipefail + yarn bundle:ios + working-directory: apps/fluent-tester + + - name: Pod install + run: | + set -eox pipefail + pod install --verbose + working-directory: apps/fluent-tester/ios + + - name: Build iOS app + run: | + set -eox pipefail + ./.ado/scripts/xcodebuild.sh apps/fluent-tester/ios/FluentTester.xcworkspace iphonesimulator ReactTestApp build + env: + CCACHE_DISABLE: 1 + + # iOS E2E tests are currently disabled + # - name: Prepare E2E iOS tests + # run: yarn e2eprep:ios + # working-directory: apps/E2E + # - name: Run E2E iOS tests + # run: yarn e2etest:ios + # working-directory: apps/E2E + + windows: + name: Windows PR + runs-on: windows-latest + timeout-minutes: 60 + steps: + - name: Checkout + uses: actions/checkout@v4 + with: + fetch-depth: 5 + + - name: Set up toolchain + uses: microsoft/react-native-test-app/.github/actions/setup-toolchain@5.0.14 + with: + platform: windows + node-version: 22 + + - name: Install dependencies + run: yarn + + - name: Build packages + run: yarn build + + - name: Bundle Windows + run: yarn bundle:windows + working-directory: apps/fluent-tester + + - name: Install WinAppDriver 1.1 + run: | + Invoke-WebRequest https://github.com/microsoft/WinAppDriver/releases/download/v1.1/WindowsApplicationDriver.msi -OutFile $env:RUNNER_TEMP\WinAppDriver.msi + Start-Process msiexec -ArgumentList "/quiet","/x","{087BBF93-D9E3-4D27-BDBE-9C702E0066FC}" -Verb runAs -Wait + Start-Process msiexec -ArgumentList "/quiet","/i","$env:RUNNER_TEMP\WinAppDriver.msi" -Verb runAs -Wait + shell: powershell + + - name: Generate UWP app + run: yarn install-windows-test-app --use-nuget + working-directory: apps/fluent-tester + + - name: Build UWP app + run: yarn windows --arch x64 --logging --no-packager --no-launch --msbuildprops WindowsTargetPlatformVersion=10.0.26100.0 + working-directory: apps/fluent-tester + + - name: Prepare E2E Windows tests + run: yarn e2eprep:windows + working-directory: apps/E2E + + - name: Run E2E UWP tests + run: yarn e2etest:windows + working-directory: apps/E2E + + - name: Upload E2E Windows artifacts + if: ${{ always() }} + uses: actions/upload-artifact@v4 + with: + name: E2E_UWP_Dump + path: | + apps/E2E/reports + apps/E2E/errorShots + + win32: + name: Win32 PR + runs-on: windows-latest + timeout-minutes: 60 + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Set up toolchain + uses: microsoft/react-native-test-app/.github/actions/setup-toolchain@5.0.14 + with: + platform: windows + node-version: 22 + + - name: Install dependencies + run: yarn + + - name: Build packages + run: yarn build + + - name: Bundle Win32 + run: yarn bundle + working-directory: apps/win32 + + - name: Install WinAppDriver 1.1 + run: | + Invoke-WebRequest https://github.com/microsoft/WinAppDriver/releases/download/v1.1/WindowsApplicationDriver.msi -OutFile $env:RUNNER_TEMP\WinAppDriver.msi + Start-Process msiexec -ArgumentList "/quiet","/x","{087BBF93-D9E3-4D27-BDBE-9C702E0066FC}" -Verb runAs -Wait + Start-Process msiexec -ArgumentList "/quiet","/i","$env:RUNNER_TEMP\WinAppDriver.msi" -Verb runAs -Wait + shell: powershell + + - name: Prepare E2E Win32 tests + run: yarn e2eprep:win32 + working-directory: apps/E2E + + - name: Run E2E Win32 tests + run: yarn e2etest:win32 + working-directory: apps/E2E + + - name: Upload E2E Win32 artifacts + if: ${{ always() }} + uses: actions/upload-artifact@v4 + with: + name: E2E_win32_Dump + path: | + apps/E2E/reports + apps/E2E/errorShots + + test-links: + name: Test repo links + runs-on: ubuntu-latest + timeout-minutes: 60 + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Set up toolchain + uses: microsoft/react-native-test-app/.github/actions/setup-toolchain@5.0.14 + with: + node-version: 22 + + - name: Install dependencies + run: yarn + + - name: Test markdown links + run: | + find . -name \*.md -not -name CHANGELOG.md -not -path '*/node_modules/*' -print0 | xargs -0 -n1 yarn test-links -c $(pwd)/.ado/markdown-link-check-config.json + + pr: + name: PR + runs-on: ubuntu-latest + needs: + - js + - android + - macos + - ios + - windows + - win32 + - test-links + steps: + - name: All required jobs passed + run: echo "All required jobs completed."