E2E Android TV (Maestro) #75
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 Android TV (Maestro) | |
| on: | |
| pull_request: | |
| paths: | |
| - 'src/**' | |
| - 'App.tsx' | |
| - '.maestro/**' | |
| - 'package.json' | |
| - 'yarn.lock' | |
| - 'app.json' | |
| - 'eas.json' | |
| - '.github/workflows/e2e-android-tv.yml' | |
| schedule: | |
| - cron: '0 7 * * *' # nightly 07:00 UTC | |
| workflow_dispatch: | |
| concurrency: | |
| group: e2e-android-tv-${{ github.ref }} | |
| cancel-in-progress: true | |
| permissions: | |
| contents: read | |
| env: | |
| YARN_ENABLE_HARDENED_MODE: "1" | |
| jobs: | |
| maestro: | |
| name: Tier 1 flows on Google TV API 34 | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 45 | |
| env: | |
| EXPO_PUBLIC_FREEPLAY_ENV: staging | |
| steps: | |
| - uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4.3.1 | |
| - name: Enable KVM | |
| 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 | |
| - name: Enable Corepack | |
| run: corepack enable | |
| - uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0 | |
| with: | |
| node-version: 22 | |
| cache: yarn | |
| - uses: actions/setup-java@c1e323688fd81a25caa38c78aa6df2d33d3e20d9 # v4.8.0 | |
| with: | |
| distribution: temurin | |
| java-version: 17 | |
| - name: Install Maestro | |
| run: | | |
| curl -fsSL "https://get.maestro.mobile.dev" | bash | |
| echo "$HOME/.maestro/bin" >> "$GITHUB_PATH" | |
| - run: yarn install --immutable | |
| - name: Cache Gradle | |
| uses: actions/cache@0057852bfaa89a56745cba8c7296529d2fc39830 # v4.3.0 | |
| with: | |
| path: | | |
| ~/.gradle/caches | |
| ~/.gradle/wrapper | |
| android/.gradle | |
| key: gradle-${{ runner.os }}-${{ hashFiles('android/**/*.gradle*', 'android/**/gradle-wrapper.properties', 'yarn.lock') }} | |
| restore-keys: gradle-${{ runner.os }}- | |
| - name: Prebuild Android (creates android/ from app.json) | |
| run: yarn expo prebuild --platform android --no-install | |
| - name: Build debug APK | |
| working-directory: android | |
| run: ./gradlew assembleDebug -x lint | |
| # The reactivecircus action handles AVD creation, snapshot caching, and | |
| # boot. profile=tv_1080p targets the Google TV form factor; api 34 has | |
| # the latest google_apis_playstore image with TV support. | |
| - name: Run Maestro flows on Android TV emulator | |
| uses: reactivecircus/android-emulator-runner@e89f39f1abbbd05b1113a29cf4db69e7540cae5a # v2.9.0 | |
| with: | |
| api-level: 34 | |
| target: google_apis_playstore | |
| arch: x86_64 | |
| profile: tv_1080p | |
| emulator-options: -no-window -no-audio -no-snapshot-save -gpu swiftshader_indirect -no-boot-anim -camera-back none | |
| disable-animations: true | |
| script: | | |
| adb wait-for-device | |
| adb install -r android/app/build/outputs/apk/debug/app-debug.apk | |
| mkdir -p maestro-report | |
| maestro test .maestro/flows/ --format junit --output maestro-report/junit.xml | |
| - name: Upload Maestro artifacts | |
| if: always() | |
| uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2 | |
| with: | |
| name: maestro-report | |
| path: | | |
| maestro-report/ | |
| ~/.maestro/tests/ | |
| retention-days: 14 |