E2E / f0rr0/reduce-oliphaunt-icu-crate-size #316
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: E2E | |
| run-name: E2E / ${{ github.event_name == 'workflow_run' && github.event.workflow_run.head_branch || github.ref_name }} | |
| on: | |
| workflow_run: # zizmor: ignore[dangerous-triggers] read-only artifact consumer; permissions are actions:read/contents:read and no untrusted code runs with write credentials. | |
| workflows: ["CI"] | |
| types: [completed] | |
| workflow_dispatch: | |
| inputs: | |
| sha: | |
| description: Commit SHA whose CI build artifacts should be tested. Defaults to the current ref SHA. | |
| required: false | |
| type: string | |
| platform: | |
| description: Mobile platform to test. | |
| required: true | |
| default: all | |
| type: choice | |
| options: | |
| - all | |
| - android | |
| - ios | |
| permissions: | |
| actions: read | |
| contents: read | |
| concurrency: | |
| group: mobile-e2e-${{ github.event_name == 'workflow_run' && github.event.workflow_run.head_sha || inputs.sha || github.sha }}-${{ inputs.platform || 'all' }} | |
| cancel-in-progress: false | |
| env: | |
| NODE_VERSION: 22.22.3 | |
| PNPM_VERSION: 11.5.0 | |
| BUN_VERSION: 1.3.14 | |
| jobs: | |
| resolve: | |
| name: resolve-build-artifacts | |
| if: ${{ github.event_name != 'workflow_run' || github.event.workflow_run.conclusion == 'success' }} | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 10 | |
| outputs: | |
| android: ${{ steps.plan.outputs.android }} | |
| ios: ${{ steps.plan.outputs.ios }} | |
| run_id: ${{ steps.plan.outputs.run_id }} | |
| sha: ${{ steps.plan.outputs.sha }} | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd | |
| with: | |
| fetch-depth: 1 | |
| ref: ${{ github.event.workflow_run.head_sha || inputs.sha || github.sha }} | |
| persist-credentials: false | |
| - name: Set up Bun | |
| uses: ./.github/actions/setup-bun | |
| with: | |
| bun-version: ${{ env.BUN_VERSION }} | |
| - name: Resolve mobile app artifacts | |
| id: plan | |
| env: | |
| GH_TOKEN: ${{ github.token }} | |
| GH_REPO: ${{ github.repository }} | |
| EVENT_NAME: ${{ github.event_name }} | |
| WORKFLOW_RUN_ID: ${{ github.event.workflow_run.id || '' }} | |
| WORKFLOW_RUN_SHA: ${{ github.event.workflow_run.head_sha || '' }} | |
| INPUT_SHA: ${{ inputs.sha || '' }} | |
| INPUT_PLATFORM: ${{ inputs.platform || 'all' }} | |
| DEFAULT_SHA: ${{ github.sha }} | |
| BUILD_GATE_JOB: Builds | |
| run: bun .github/scripts/resolve-mobile-e2e.mjs | |
| android: | |
| name: android-installed-app | |
| needs: | |
| - resolve | |
| if: ${{ needs.resolve.outputs.android == 'true' }} | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 45 | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd | |
| with: | |
| fetch-depth: 1 | |
| ref: ${{ needs.resolve.outputs.sha }} | |
| persist-credentials: false | |
| - name: Set up Node and pnpm | |
| uses: ./.github/actions/setup-node-pnpm | |
| with: | |
| node-version: ${{ env.NODE_VERSION }} | |
| pnpm-version: ${{ env.PNPM_VERSION }} | |
| - name: Set up Android | |
| uses: ./.github/actions/setup-android | |
| - name: Set up Maestro | |
| uses: ./.github/actions/setup-maestro | |
| - name: Download Android app artifact | |
| env: | |
| GH_TOKEN: ${{ github.token }} | |
| run: | | |
| mkdir -p target/mobile-build/react-native/android | |
| gh run download '${{ needs.resolve.outputs.run_id }}' \ | |
| --name react-native-mobile-android-app-android-x86_64 \ | |
| --dir target/mobile-build/react-native/android | |
| find target/mobile-build/react-native/android -maxdepth 2 -type f -print | |
| - name: Start Android emulator | |
| env: | |
| OLIPHAUNT_ANDROID_EMULATOR_API: "35" | |
| run: tools/dev/start-android-emulator-ci.sh | |
| - name: Run Android installed-app E2E | |
| env: | |
| OLIPHAUNT_EXPO_ANDROID_BUILD_ARTIFACT_DIR: ${{ github.workspace }}/target/mobile-build/react-native/android | |
| OLIPHAUNT_EXPO_ANDROID_BUILD_TYPE: release | |
| OLIPHAUNT_EXPO_ANDROID_LIFECYCLE_SMOKE: "0" | |
| OLIPHAUNT_MOBILE_E2E_ASSERTION_RUNNER: maestro | |
| run: bash src/sdks/react-native/tools/mobile-e2e.sh android | |
| - name: Upload Android E2E reports | |
| if: ${{ always() }} | |
| uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a | |
| with: | |
| name: react-native-mobile-android-e2e-reports | |
| path: | | |
| target/mobile/react-native/android-e2e/reports | |
| target/mobile/react-native/android-e2e/logs | |
| ${{ runner.temp }}/oliphaunt-android-emulator.log | |
| if-no-files-found: ignore | |
| ios: | |
| name: ios-installed-app | |
| needs: | |
| - resolve | |
| if: ${{ needs.resolve.outputs.ios == 'true' }} | |
| runs-on: macos-26 | |
| timeout-minutes: 45 | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd | |
| with: | |
| fetch-depth: 1 | |
| ref: ${{ needs.resolve.outputs.sha }} | |
| persist-credentials: false | |
| - name: Set up Node and pnpm | |
| uses: ./.github/actions/setup-node-pnpm | |
| with: | |
| node-version: ${{ env.NODE_VERSION }} | |
| pnpm-version: ${{ env.PNPM_VERSION }} | |
| - name: Set up Apple | |
| uses: ./.github/actions/setup-apple | |
| - name: Set up Maestro | |
| uses: ./.github/actions/setup-maestro | |
| - name: Download iOS app artifact | |
| env: | |
| GH_TOKEN: ${{ github.token }} | |
| run: | | |
| mkdir -p target/mobile-build/react-native/ios | |
| gh run download '${{ needs.resolve.outputs.run_id }}' \ | |
| --name react-native-mobile-ios-app \ | |
| --dir target/mobile-build/react-native/ios | |
| find target/mobile-build/react-native/ios -maxdepth 2 -print | |
| - name: Run iOS installed-app E2E | |
| env: | |
| OLIPHAUNT_EXPO_IOS_BUILD_ARTIFACT_DIR: ${{ github.workspace }}/target/mobile-build/react-native/ios | |
| OLIPHAUNT_EXPO_IOS_CONFIGURATION: Release | |
| OLIPHAUNT_EXPO_IOS_SDK: iphonesimulator | |
| OLIPHAUNT_EXPO_IOS_LIFECYCLE_SMOKE: "0" | |
| OLIPHAUNT_MOBILE_E2E_ASSERTION_RUNNER: maestro | |
| MAESTRO_DRIVER_STARTUP_TIMEOUT: "300000" | |
| run: bash src/sdks/react-native/tools/mobile-e2e.sh ios | |
| - name: Upload iOS E2E reports | |
| if: ${{ always() }} | |
| uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a | |
| with: | |
| name: react-native-mobile-ios-e2e-reports | |
| path: | | |
| target/mobile/react-native/ios-e2e/reports | |
| target/mobile/react-native/ios-e2e/logs | |
| target/mobile/react-native/ios-e2e/*.log | |
| if-no-files-found: ignore | |
| required: | |
| name: E2E | |
| if: ${{ always() }} | |
| needs: | |
| - resolve | |
| - android | |
| - ios | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 5 | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd | |
| with: | |
| fetch-depth: 1 | |
| ref: ${{ github.event.workflow_run.head_sha || inputs.sha || github.sha }} | |
| persist-credentials: false | |
| - name: Set up Bun | |
| uses: ./.github/actions/setup-bun | |
| with: | |
| bun-version: ${{ env.BUN_VERSION }} | |
| - name: Check E2E jobs | |
| env: | |
| NEEDS_JSON: ${{ toJson(needs) }} | |
| REQUIRED_JOBS_JSON: '["resolve","android","ios"]' | |
| GATE_LABEL: E2E jobs | |
| run: bun .github/scripts/check-ci-gate.mjs allow-skipped |