Skip to content

Merge pull request #1125 from morckx/upgrade-target-tools-and-depende… #305

Merge pull request #1125 from morckx/upgrade-target-tools-and-depende…

Merge pull request #1125 from morckx/upgrade-target-tools-and-depende… #305

name: RadioDroid Instrumented Tests CI
on:
push:
branches:
- master
# pull_request:
# branches:
# - master
jobs:
test:
runs-on: macos-latest
strategy:
matrix:
api-level: [16, 27, 33]
steps:
- name: checkout
uses: actions/checkout@v3
- name: Restore Android virtual device
uses: actions/cache@v3
id: avd-cache
with:
path: |
~/.android/avd/*
~/.android/adb*
key: RadioDroid-${{ runner.os }}-avd-api${{ matrix.api-level }}
- name: set up JDK 11
uses: actions/setup-java@v3
with:
java-version: '11'
distribution: 'zulu'
- name: Set up Android virtual device if not cached
uses: reactivecircus/android-emulator-runner@v2
if: steps.avd-cache.outputs.cache-hit != 'true'
with:
api-level: ${{ matrix.api-level }}
arch: ${{ matrix.api-level < 21 && 'x86' || 'x86_64' }}
target: ${{ matrix.api-level >= 30 && 'google_apis' || 'default' }}
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 instrumented tests on Android virtual device
uses: reactivecircus/android-emulator-runner@v2
with:
api-level: ${{ matrix.api-level }}
arch: ${{ matrix.api-level < 21 && 'x86' || 'x86_64' }}
target: ${{ matrix.api-level >= 30 && 'google_apis' || 'default' }}
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: /Users/runner/Library/Android/sdk/platform-tools/adb uninstall net.programmierecke.radiodroid2.test; ./gradlew ${{ matrix.api-level < 26 && 'connectedFreeDebugAndroidTest' || matrix.api-level > 29 && 'installPlayDebugAndroidTest' || 'connectedCheck' }}