Skip to content

Commit

Permalink
feat: add AVD snapshot generation
Browse files Browse the repository at this point in the history
  • Loading branch information
spion committed Aug 18, 2024
1 parent 4bcdec7 commit c266959
Showing 1 changed file with 29 additions and 9 deletions.
38 changes: 29 additions & 9 deletions .github/workflows/ccpp.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,9 @@ jobs:
test:
needs: build
runs-on: ubuntu-latest
strategy:
matrix:
api-level: [29]
steps:
- uses: actions/checkout@v4
- name: prepare
Expand All @@ -39,15 +42,32 @@ jobs:
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: 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
script: echo "Generated AVD snapshot for caching."


- name: run tests
uses: reactivecircus/android-emulator-runner@v2
with:
api-level: 29
script: |
sudo bash -c 'env PATH=/usr/local/lib/android/sdk/platform-tools:$PATH ./tests/run.sh'
# services:
# emulator:
# image: budtmo/docker-android:emulator_12.0
# options: --privileged
# - name: run-tests
# run: sudo bash ./docker/run-docker-test.sh
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: sudo env PATH=/usr/local/lib/android/sdk/platform-tools:$PATH ./tests/run.sh

0 comments on commit c266959

Please sign in to comment.