Skip to content

stabilize android test #13

stabilize android test

stabilize android test #13

name: Android E2E (Github Actions Ubuntu)
on: [push, pull_request]
jobs:
run_android_e2e:
timeout-minutes: 90
runs-on: ubuntu-latest
strategy:
fail-fast: false
max-parallel: 10
matrix:
arch: [x86, x86_64]
# ^^^ `runs-on: ubuntu-*` doesn't support `arm64-v8a`
api-level: [26, 27, 28, 29]
# api-level:
# 1. `30+` required KVM to be enabled (see: https://github.com/ReactiveCircus/android-emulator-runner/issues/46)
# 2. `21` is the minimum API level supported by React Native
target: [default, google_apis, google_apis_playstore]
exclude:
# Exclude combinations that are not supported by the Android SDK
# Print all available Android emulators: `sdkmanager --list --verbose | grep system-images`
# google_apis
- target: google_apis
api-level: 27
arch: x86_64
# google_apis_playstore
- target: google_apis_playstore
api-level: 21
- target: google_apis_playstore
api-level: 22
- target: google_apis_playstore
api-level: 23
- target: google_apis_playstore
api-level: 24
arch: x86_64
- target: google_apis_playstore
api-level: 25
arch: x86_64
- target: google_apis_playstore
api-level: 26
arch: x86_64
- target: google_apis_playstore
api-level: 27
arch: x86_64
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 1
- run: npx envinfo
- name: Setup Java
uses: actions/setup-java@v3
with:
distribution: temurin
java-version: 11
- name: Install Maestro
run: MAESTRO_VERSION=1.30.4 curl -Ls 'https://get.maestro.mobile.dev' | bash
- name: Run Maestro E2E tests
uses: reactivecircus/android-emulator-runner@v2
with:
api-level: ${{ matrix.api-level }}
target: ${{ matrix.target }}
arch: ${{ matrix.arch }}
cores: 2
ram-size: 2048M
force-avd-creation: false
emulator-boot-timeout: 600 # 10min
emulator-options: -no-window -gpu swiftshader_indirect -noaudio -no-boot-anim -camera-back none
disable-animations: true
pre-emulator-launch-script: |
echo "Running pre emulator launch script. Printing the working directory now:"
pwd
script: |
# check memory usage
npx envinfo
# verify emulator is running
adb devices
# Install app
adb install app-release.apk || (adb kill-server && adb start-server && adb devices && adb install app-release.apk)
# Run e2e
./run_android_e2e.sh
# ^^^ Will debug files: report*.xml, video_record.mp4, last_img.png
- name: Upload report
if: always()
uses: actions/upload-artifact@v3
with:
name: E2E Report (${{ matrix.arch }}, ${{ matrix.api-level }}, ${{ matrix.target }})
path: |
${{ github.workspace }}/*.mp4
${{ github.workspace }}/*.png
${{ github.workspace }}/report*.xml
~/.maestro/tests/**/*