RN Stripe #2443
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: RN Stripe | |
| on: | |
| push: | |
| branches: [master] | |
| pull_request: | |
| branches: ['**'] | |
| schedule: | |
| - cron: '0 7 * * *' # run at 7 AM UTC, 12 AM PST | |
| workflow_dispatch: # manually trigger the e2e tests | |
| jobs: | |
| test-android: | |
| name: e2e-android-test | |
| runs-on: ubuntu-24.04 | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| react_arch: [old_arch, new_arch] | |
| shard_index: [0, 1, 2] | |
| env: | |
| MAESTRO_CLI_ANALYSIS_NOTIFICATION_DISABLED: true | |
| NEW_ARCH_ENABLED: ${{ matrix.react_arch == 'new_arch' }} | |
| RCT_NEW_ARCH_ENABLED: ${{ matrix.react_arch == 'new_arch' && '1' || '0' }} | |
| SHARD_COUNT: 3 | |
| SHARD_INDEX: ${{ matrix.shard_index }} | |
| RETRY_SLEEP_FAST: 10 | |
| RETRY_SLEEP_SLOW: 45 | |
| steps: | |
| # Enable KVM to be able to use hardware accelerated emulators. | |
| # https://github.com/ReactiveCircus/android-emulator-runner?tab=readme-ov-file#running-hardware-accelerated-emulators-on-linux-runners | |
| - name: Enable KVM group perms | |
| run: | | |
| echo 'KERNEL=="kvm", GROUP="kvm", MODE="0666", OPTIONS+="static_node=kvm"' | sudo tee /etc/udev/rules.d/99-kvm4all.rules | |
| sudo udevadm control --reload-rules | |
| sudo udevadm trigger --name-match=kvm | |
| ls /dev/kvm | |
| - name: checkout | |
| uses: actions/checkout@v4 | |
| - name: Get yarn cache directory path | |
| id: yarn-cache-dir-path | |
| run: echo "::set-output name=dir::$(yarn cache dir)" | |
| - uses: actions/cache@v4 | |
| id: yarn-cache | |
| with: | |
| path: ${{ steps.yarn-cache-dir-path.outputs.dir }} | |
| key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }} | |
| restore-keys: | | |
| ${{ runner.os }}-yarn- | |
| - name: Setup Node.js environment | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: 20 | |
| - name: Install Dependencies | |
| run: yarn bootstrap-no-pods | |
| - name: Setup Java environment | |
| uses: actions/setup-java@v4 | |
| with: | |
| distribution: 'zulu' | |
| java-version: '17' | |
| - name: Cache Gradle build | |
| uses: gradle/actions/setup-gradle@v4 | |
| - name: Build Android App | |
| run: | | |
| cd example/android | |
| yarn build:android | |
| ./gradlew assembleRelease -PnewArchEnabled=$NEW_ARCH_ENABLED -PreactNativeArchitectures=x86_64 --no-daemon --build-cache --no-scan | |
| - name: Install Maestro CLI | |
| run: | | |
| curl -Ls "https://get.maestro.mobile.dev" | bash | |
| echo "${HOME}/.maestro/bin" >> $GITHUB_PATH | |
| - name: Run Android Emulator and run tests | |
| id: android_tests | |
| uses: reactivecircus/android-emulator-runner@v2 | |
| with: | |
| api-level: 33 | |
| # This build is the most stable for API 33. Others appear to have a significant amount of ColorBuffer emulator errors. | |
| # While those errors don't affect the test outcome, best to be on the most stable build. | |
| emulator-build: 11237101 | |
| arch: x86_64 | |
| target: google_apis | |
| force-avd-creation: false | |
| emulator-options: -no-snapshot-save -no-window -gpu swiftshader_indirect -noaudio -no-boot-anim -camera-back none | |
| disable-animations: true | |
| script: | | |
| # Wait for system to settle | |
| adb wait-for-device shell 'while [[ -z $(getprop sys.boot_completed) ]]; do sleep 1; done' | |
| adb install -r example/android/app/build/outputs/apk/release/app-release.apk | |
| yarn test:e2e:android | |
| - name: Upload test artifacts | |
| if: always() | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: maestro-artifacts-android-${{ matrix.react_arch }}-shard-${{ matrix.shard_index }} | |
| path: e2e-artifacts | |
| include-hidden-files: true | |
| - name: Send Financial Connections Slack notification | |
| if: always() && steps.android_tests.outputs.FINANCIAL_CONNECTIONS_TESTS_FAILED == 'true' | |
| uses: slackapi/slack-github-action@v2.1.1 | |
| with: | |
| webhook: ${{ secrets.SLACK_LINK_MOBILE_ALERT_CHANNEL_WEBHOOK_URL }} | |
| webhook-type: incoming-webhook | |
| payload: | | |
| { | |
| "text": "🚨 *Financial Connections Tests Failed* on Android (${{ matrix.react_arch }})", | |
| "blocks": [ | |
| { | |
| "type": "section", | |
| "text": { | |
| "type": "mrkdwn", | |
| "text": "🚨 *Financial Connections Tests Failed* on Android (${{ matrix.react_arch }})" | |
| } | |
| }, | |
| { | |
| "type": "section", | |
| "fields": [ | |
| { | |
| "type": "mrkdwn", | |
| "text": "*Failed Tests:*\n${{ steps.android_tests.outputs.FAILED_FC_TESTS }}" | |
| }, | |
| { | |
| "type": "mrkdwn", | |
| "text": "*Branch:*\n${{ github.ref_name }}" | |
| }, | |
| { | |
| "type": "mrkdwn", | |
| "text": "*Commit:*\n${{ github.sha }}" | |
| }, | |
| { | |
| "type": "mrkdwn", | |
| "text": "*Triggered by:*\n${{ github.event_name }}" | |
| } | |
| ] | |
| }, | |
| { | |
| "type": "actions", | |
| "elements": [ | |
| { | |
| "type": "button", | |
| "text": { | |
| "type": "plain_text", | |
| "text": "View Build" | |
| }, | |
| "url": "${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}" | |
| } | |
| ] | |
| } | |
| ] | |
| } | |
| - name: Send Slack notification | |
| if: ${{ failure() && github.event_name == 'schedule'}} | |
| uses: slackapi/slack-github-action@v2.1.1 | |
| with: | |
| webhook: ${{ secrets.SLACK_RUN_CHANNEL_WEBHOOK_URL }} | |
| webhook-type: incoming-webhook | |
| payload: | | |
| "text": " *Nightly Build Failed* for e2e-android-test ( ${{ matrix.react_arch }} )\nSee details: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}" | |
| test-ios: | |
| name: e2e-ios-test | |
| # Silicon chips run through the iOS tests much faster | |
| runs-on: macos-15-xlarge | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| react_arch: [old_arch, new_arch] | |
| shard_index: [0, 1, 2] | |
| env: | |
| MAESTRO_DRIVER_STARTUP_TIMEOUT: 300_000 # 5 minutes | |
| MAESTRO_CLI_ANALYSIS_NOTIFICATION_DISABLED: true | |
| NEW_ARCH_ENABLED: ${{ matrix.react_arch == 'new_arch' }} | |
| RCT_NEW_ARCH_ENABLED: ${{ matrix.react_arch == 'new_arch' && '1' || '0' }} | |
| SHARD_COUNT: 3 | |
| SHARD_INDEX: ${{ matrix.shard_index }} | |
| RETRY_SLEEP_FAST: 10 | |
| RETRY_SLEEP_SLOW: 45 | |
| steps: | |
| - name: checkout | |
| uses: actions/checkout@v4 | |
| - name: Setup Xcode | |
| run: sudo xcode-select -s /Applications/Xcode_16.3.app/Contents/Developer | |
| - name: Get yarn cache directory path | |
| id: yarn-cache-dir-path | |
| run: echo "::set-output name=dir::$(yarn cache dir)" | |
| - uses: actions/cache@v4 | |
| id: yarn-cache | |
| with: | |
| path: ${{ steps.yarn-cache-dir-path.outputs.dir }} | |
| key: ${{ runner.os }}-yarn-${{ hashFiles('example/yarn.lock') }} | |
| restore-keys: | | |
| ${{ runner.os }}-yarn- | |
| - uses: actions/cache@v4 | |
| with: | |
| path: example/ios/Pods | |
| key: ${{ runner.os }}-pods-${{ env.NEW_ARCH_ENABLED }}-${{ hashFiles('example/ios/Podfile.lock') }} | |
| restore-keys: | | |
| ${{ runner.os }}-pods-${{ env.NEW_ARCH_ENABLED }}- | |
| - name: Setup Node.js environment | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: 20 | |
| - name: Install Dependencies | |
| run: yarn bootstrap-no-pods | |
| - name: Generate bundle | |
| run: yarn example build:ios | |
| - name: Install Pods | |
| run: yarn pods | |
| env: | |
| NEW_ARCH_ENABLED: ${{ env.NEW_ARCH_ENABLED }} | |
| - name: Install Maestro CLI | |
| run: | | |
| curl -Ls "https://get.maestro.mobile.dev" | bash | |
| echo "${HOME}/.maestro/bin" >> $GITHUB_PATH | |
| - name: Build iOS App | |
| env: | |
| NEW_ARCH_ENABLED: ${{ env.NEW_ARCH_ENABLED }} | |
| RCT_NEW_ARCH_ENABLED: ${{ env.RCT_NEW_ARCH_ENABLED }} | |
| run: | | |
| yarn run-example-ios:release | |
| - name: Run tests | |
| id: ios_tests | |
| run: | | |
| yarn test:e2e:ios | |
| - name: Upload test artifacts | |
| if: always() | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: maestro-artifacts-ios-${{ matrix.react_arch }}-shard-${{ matrix.shard_index }} | |
| path: e2e-artifacts | |
| include-hidden-files: true | |
| - name: Send Financial Connections Slack notification | |
| if: always() && steps.ios_tests.outputs.FINANCIAL_CONNECTIONS_TESTS_FAILED == 'true' | |
| uses: slackapi/slack-github-action@v2.1.1 | |
| with: | |
| webhook: ${{ secrets.SLACK_LINK_MOBILE_ALERT_CHANNEL_WEBHOOK_URL }} | |
| webhook-type: incoming-webhook | |
| payload: | | |
| { | |
| "text": "🚨 *Financial Connections Tests Failed* on iOS (${{ matrix.react_arch }})", | |
| "blocks": [ | |
| { | |
| "type": "section", | |
| "text": { | |
| "type": "mrkdwn", | |
| "text": "🚨 *Financial Connections Tests Failed* on iOS (${{ matrix.react_arch }})" | |
| } | |
| }, | |
| { | |
| "type": "section", | |
| "fields": [ | |
| { | |
| "type": "mrkdwn", | |
| "text": "*Failed Tests:*\n${{ steps.ios_tests.outputs.FAILED_FC_TESTS }}" | |
| }, | |
| { | |
| "type": "mrkdwn", | |
| "text": "*Branch:*\n${{ github.ref_name }}" | |
| }, | |
| { | |
| "type": "mrkdwn", | |
| "text": "*Commit:*\n${{ github.sha }}" | |
| }, | |
| { | |
| "type": "mrkdwn", | |
| "text": "*Triggered by:*\n${{ github.event_name }}" | |
| } | |
| ] | |
| }, | |
| { | |
| "type": "actions", | |
| "elements": [ | |
| { | |
| "type": "button", | |
| "text": { | |
| "type": "plain_text", | |
| "text": "View Build" | |
| }, | |
| "url": "${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}" | |
| } | |
| ] | |
| } | |
| ] | |
| } | |
| - name: Send Slack notification | |
| if: ${{ failure() && github.event_name == 'schedule'}} | |
| uses: slackapi/slack-github-action@v2.1.1 | |
| with: | |
| webhook: ${{ secrets.SLACK_RUN_CHANNEL_WEBHOOK_URL }} | |
| webhook-type: incoming-webhook | |
| payload: | | |
| "text": "*Nightly Build Failed* for e2e-ios-test ( ${{ matrix.react_arch }} )\nSee details: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}" | |
| # Reporter jobs that provide the status checks branch protection expects | |
| report-android-status: | |
| name: e2e-android-test | |
| runs-on: ubuntu-latest | |
| needs: test-android | |
| if: always() | |
| strategy: | |
| matrix: | |
| react_arch: [old_arch, new_arch] | |
| steps: | |
| - name: Report status | |
| run: | | |
| if [[ "${{ needs.test-android.result }}" == "success" ]]; then | |
| echo "All Android tests passed for ${{ matrix.react_arch }}" | |
| exit 0 | |
| else | |
| echo "Android tests failed for ${{ matrix.react_arch }}" | |
| exit 1 | |
| fi | |
| report-ios-status: | |
| name: e2e-ios-test | |
| runs-on: ubuntu-latest | |
| needs: test-ios | |
| if: always() | |
| strategy: | |
| matrix: | |
| react_arch: [old_arch, new_arch] | |
| steps: | |
| - name: Report status | |
| run: | | |
| if [[ "${{ needs.test-ios.result }}" == "success" ]]; then | |
| echo "All iOS tests passed for ${{ matrix.react_arch }}" | |
| exit 0 | |
| else | |
| echo "iOS tests failed for ${{ matrix.react_arch }}" | |
| exit 1 | |
| fi |