Issue#74 Attempt to integrate testing on emulator
Using [AndroidEmulator Runner Action](https://github.com/ReactiveCircus/android-emulator-runner)
This commit is contained in:
parent
e05d2feb0c
commit
bdc3f1560f
1 changed files with 51 additions and 0 deletions
51
.github/workflows/pull-request-jobs.yml
vendored
51
.github/workflows/pull-request-jobs.yml
vendored
|
|
@ -73,3 +73,54 @@ jobs:
|
||||||
name: JVM Test Results
|
name: JVM Test Results
|
||||||
path: ./**/build/reports/tests/**/index.html
|
path: ./**/build/reports/tests/**/index.html
|
||||||
retention-days: 1
|
retention-days: 1
|
||||||
|
|
||||||
|
run-tests-on-emulator:
|
||||||
|
runs-on: macos-latest
|
||||||
|
strategy:
|
||||||
|
matrix:
|
||||||
|
api-level: [ 21, 30 ]
|
||||||
|
fail-fast: false
|
||||||
|
steps:
|
||||||
|
- name: checkout
|
||||||
|
uses: actions/checkout@v3
|
||||||
|
- name: Setup Java
|
||||||
|
uses: actions/setup-java@v2
|
||||||
|
with:
|
||||||
|
distribution: 'adopt'
|
||||||
|
java-version: '11'
|
||||||
|
- name: Gradle cache
|
||||||
|
uses: gradle/gradle-build-action@v2
|
||||||
|
- name: AVD cache
|
||||||
|
uses: actions/cache@v3
|
||||||
|
id: avd-cache
|
||||||
|
with:
|
||||||
|
path: |
|
||||||
|
~/.android/avd/*
|
||||||
|
~/.android/adb*
|
||||||
|
key: avd-${{ matrix.api-level }}
|
||||||
|
- name: create AVD and generate snapshot for caching
|
||||||
|
if: steps.avd-cache.outputs.cache-hit != 'true'
|
||||||
|
uses: reactivecircus/android-emulator-runner@v2
|
||||||
|
with:
|
||||||
|
arch: 'x86_64'
|
||||||
|
api-level: ${{ matrix.api-level }}
|
||||||
|
force-avd-creation: false
|
||||||
|
emulator-options: -no-window -gpu swiftshader_indirect -noaudio -no-boot-anim -camera-back none
|
||||||
|
disable-animations: false
|
||||||
|
script: echo "Generated AVD snapshot for caching."
|
||||||
|
- name: Run Android Tests
|
||||||
|
uses: reactivecircus/android-emulator-runner@v2
|
||||||
|
with:
|
||||||
|
arch: 'x86_64'
|
||||||
|
api-level: ${{ matrix.api-level }}
|
||||||
|
force-avd-creation: false
|
||||||
|
emulator-options: -no-snapshot-save -no-window -gpu swiftshader_indirect -noaudio -no-boot-anim -camera-back none
|
||||||
|
disable-animations: true
|
||||||
|
script: ./gradlew connectedDebugAndroidTest
|
||||||
|
- name: Upload Test Results
|
||||||
|
uses: actions/upload-artifact@v2
|
||||||
|
if: always()
|
||||||
|
with:
|
||||||
|
name: Emulator-Test-Results-${{ matrix.api-level }}
|
||||||
|
path: ./**/build/reports/androidTests/**/*.html
|
||||||
|
retention-days: 1
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue