Skip to content

Commit

Permalink
Update android test action
Browse files Browse the repository at this point in the history
  • Loading branch information
kylecorry31 committed Jul 21, 2024
1 parent b2dceca commit d80ad00
Showing 1 changed file with 42 additions and 4 deletions.
46 changes: 42 additions & 4 deletions .github/workflows/android-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,18 +9,56 @@ on:
jobs:
android_test:
runs-on: ubuntu-latest
strategy:
matrix:
api-level: [23, 35]
steps:
- name: Checkout code
uses: actions/checkout@v3
- uses: actions/checkout@v3
with:
fetch-depth: 0

- name: set up JDK 17
uses: actions/setup-java@v4
with:
distribution: "temurin"
java-version: 17

- name: Make gradlew executable
run: chmod +x gradlew

- name: Enable KVM
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 tests
- name: Gradle cache
uses: gradle/actions/setup-gradle@v3

- name: AVD cache
uses: actions/cache@v4
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:
api-level: ${{ matrix.api-level }}
force-avd-creation: false
emulator-options: -no-window -gpu swiftshader_indirect -noaudio -no-boot-anim\
disable-animations: false
script: echo "Generated AVD snapshot for caching."

- name: run tests
uses: reactivecircus/android-emulator-runner@v2
with:
api-level: 23
api-level: ${{ matrix.api-level }}
force-avd-creation: false
emulator-options: -no-snapshot-save -no-window -gpu swiftshader_indirect -noaudio -no-boot-anim
disable-animations: true
script: ./gradlew connectedCheck

0 comments on commit d80ad00

Please # to comment.