Skip to content

Commit

Permalink
add caching & scaffold matrix
Browse files Browse the repository at this point in the history
  • Loading branch information
bertrmz committed Mar 18, 2024
1 parent 3ec70e5 commit 0526bc9
Showing 1 changed file with 30 additions and 1 deletion.
31 changes: 30 additions & 1 deletion .github/workflows/integration-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@ on:
jobs:
test:
runs-on: ubuntu-latest
strategy:
matrix:
api-level: [33] # TODO: add more api levels to test
env:
MAILOSAUR_API_KEY: ${{ secrets.MAILOSAUR_API_KEY }}
steps:
Expand All @@ -23,9 +26,35 @@ jobs:
sudo udevadm control --reload-rules
sudo udevadm trigger --name-match=kvm
- 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 -camera-back none
disable-animations: false
arch: x86_64
script: echo "Generated AVD snapshot for caching."

- name: run tests
uses: reactivecircus/android-emulator-runner@v2
with:
api-level: 33
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
arch: x86_64
script: ./gradlew connectedDebugAndroidTest

0 comments on commit 0526bc9

Please sign in to comment.