mirror of
https://github.com/reactivecircus/android-emulator-runner.git
synced 2026-08-31 17:49:33 +00:00
a2c97ef57f
* Gradle 8.0.2 for test-fixture. Update Gradle build cache in workflows. * Update all dependencies for `test-fixture`. * Add missing JVM target.
125 lines
3.2 KiB
YAML
125 lines
3.2 KiB
YAML
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:
|
|
os: [macos-latest, ubuntu-latest]
|
|
api-level: [16, 23, 29]
|
|
target: [default, google_apis]
|
|
arch: [x86]
|
|
exclude:
|
|
- os: ubuntu-latest
|
|
api-level: 23
|
|
- os: ubuntu-latest
|
|
api-level: 29
|
|
- target: google_apis
|
|
api-level: 16
|
|
- target: google_apis
|
|
api-level: 23
|
|
- target: google_apis
|
|
api-level: 29
|
|
include:
|
|
- os: macos-latest
|
|
api-level: 24
|
|
target: playstore
|
|
arch: x86
|
|
- os: macos-latest
|
|
api-level: 30
|
|
target: aosp_atd
|
|
arch: x86
|
|
- os: macos-11
|
|
api-level: 31
|
|
target: google_apis
|
|
arch: x86_64
|
|
|
|
steps:
|
|
- name: checkout
|
|
uses: actions/checkout@v3
|
|
|
|
- name: validate gradle wrapper
|
|
uses: gradle/wrapper-validation-action@v1
|
|
|
|
- name: build, test and lint
|
|
run: |
|
|
npm install
|
|
npm run build
|
|
npm run lint
|
|
npm test
|
|
|
|
- uses: actions/setup-java@v3
|
|
with:
|
|
distribution: 'zulu'
|
|
java-version: 19
|
|
|
|
- uses: actions/cache@v3
|
|
id: avd-cache
|
|
with:
|
|
path: |
|
|
~/.android/avd/*
|
|
~/.android/adb*
|
|
~/.android/debug.keystore
|
|
key: avd-${{ matrix.api-level }}-${{ matrix.os }}-${{ matrix.target }}
|
|
|
|
- name: assemble tests
|
|
uses: gradle/gradle-build-action@v2
|
|
with:
|
|
build-root-directory: test-fixture
|
|
arguments: assembleAndroidTest
|
|
|
|
- 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 }}
|
|
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 }}
|
|
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
|