Run android instrumented tests #407
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Run android instrumented tests | |
# Run Android instrumented tests once every day at 1am UTC. | |
on: | |
schedule: | |
- cron: '0 1 * * *' | |
workflow_dispatch: | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.head_ref || github.ref }} | |
cancel-in-progress: true | |
env: | |
RAWG_API_KEY: ${{ secrets.RAWG_API_KEY }} | |
BUGSNAG_API_KEY: ${{ secrets.BUGSNAG_API_KEY }} | |
jobs: | |
androidTest: | |
runs-on: ubuntu-latest # enables hardware acceleration in the virtual machine | |
timeout-minutes: 30 | |
strategy: | |
matrix: | |
api-level: [ 29, 30, 31, 33, 34 ] | |
steps: | |
- name: Enable KVM group perms | |
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 | |
ls /dev/kvm | |
- name: Checkout | |
uses: actions/checkout@v3 | |
with: | |
fetch-depth: 0 | |
- name: set up JDK 17 | |
uses: actions/setup-java@v3 | |
with: | |
java-version: '17' | |
distribution: 'zulu' | |
- name: Setup Gradle | |
uses: gradle/[email protected] | |
- name: Grant execute permission for gradlew | |
run: chmod +x gradlew | |
- name: Run instrumentation tests | |
uses: reactivecircus/android-emulator-runner@v2 | |
with: | |
api-level: ${{ matrix.api-level }} | |
arch: x86_64 | |
target: google_apis | |
disable-animations: true | |
disk-size: 6000M | |
heap-size: 600M | |
script: ./gradlew connectedDebugAndroidTest --stacktrace --daemon | |
- name: Upload test reports | |
if: always() | |
uses: actions/upload-artifact@v3 | |
with: | |
name: test-reports-${{ matrix.api-level }} | |
path: ./**/build/reports |