name: Main workflow on: workflow_call: pull_request: paths-ignore: - '**.md' push: branches: - main paths-ignore: - '**.md' jobs: test: runs-on: ${{ matrix.os }} env: JAVA_TOOL_OPTIONS: -Xmx4g timeout-minutes: 15 strategy: matrix: include: - os: ubuntu-22.04 api-level: 23 target: default arch: x86 - os: ubuntu-24.04 api-level: 24 target: playstore arch: x86 - os: macos-15-intel api-level: 31 target: default arch: x86_64 - os: ubuntu-24.04 api-level: 34 target: aosp_atd arch: x86_64 - os: ubuntu-latest api-level: 35 target: google_apis arch: x86_64 - os: ubuntu-latest api-level: 34-ext10 target: android-automotive arch: x86_64 system-image-api-level: 34-ext9 steps: - name: checkout uses: actions/checkout@v7 - name: build, test and lint run: | npm install npm run build npm run lint npm test - uses: actions/setup-java@v5 with: distribution: 'zulu' java-version: 25 - uses: actions/cache@v6 id: avd-cache with: path: | ~/.android/avd/* ~/.android/adb* ~/.android/debug.keystore key: avd-${{ matrix.api-level }}-${{ matrix.os }}-${{ matrix.target }}-${{ matrix.arch }} - uses: gradle/actions/setup-gradle@v6 - name: assemble tests working-directory: test-fixture run: ./gradlew assembleAndroidTest - name: enable KVM for linux runners if: runner.os == 'Linux' 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: run emulator to generate snapshot for caching if: steps.avd-cache.outputs.cache-hit != 'true' uses: ./ with: api-level: ${{ matrix.api-level }} target: ${{ matrix.target }} arch: ${{ matrix.arch }} system-image-api-level: ${{ matrix.system-image-api-level }} profile: Galaxy Nexus cores: 2 sdcard-path-or-size: 100M avd-name: test force-avd-creation: false emulator-options: -no-window -gpu swiftshader_indirect -noaudio -no-boot-anim -camera-back none disable-animations: false working-directory: ./test-fixture/ channel: canary script: echo "Generated AVD snapshot for caching." - name: run action uses: ./ with: api-level: ${{ matrix.api-level }} target: ${{ matrix.target }} arch: ${{ matrix.arch }} system-image-api-level: ${{ matrix.system-image-api-level }} profile: Galaxy Nexus cores: 2 ram-size: 2048M sdcard-path-or-size: 100M avd-name: test force-avd-creation: false emulator-options: -no-snapshot-save -no-window -gpu swiftshader_indirect -noaudio -no-boot-anim -camera-back none disable-animations: true working-directory: ./test-fixture/ channel: canary pre-emulator-launch-script: | echo "Running pre emulator launch script. Printing the working directory now:" pwd script: | echo $GITHUB_REPOSITORY adb devices ./gradlew connectedDebugAndroidTest