Skip to content

Commit

Permalink
hopee
Browse files Browse the repository at this point in the history
  • Loading branch information
Shahroz16 committed Jan 6, 2025
1 parent 9e0d32c commit 886b6e4
Showing 1 changed file with 23 additions and 13 deletions.
36 changes: 23 additions & 13 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -58,31 +58,41 @@ jobs:
sudo udevadm control --reload-rules
sudo udevadm trigger --name-match=kvm
# Modified AVD cache strategy
# Create and cache the AVD
- name: AVD cache
uses: actions/cache@v4
id: avd-cache
with:
path: |
~/.android/avd/*/*.ini
~/.android/avd/*/*.img
key: avd-${{ matrix.api-level }}-v1 # Added version suffix to invalidate old caches
~/.android/avd/*
~/.android/adb*
key: avd-${{ matrix.api-level }}-v2

# Always create a fresh AVD instance
- name: Create AVD
run: |
echo "no" | avdmanager create avd -n test -k "system-images;android-${{ matrix.api-level }};google_apis;x86_64" --force
# Create AVD and generate snapshot for caching
- name: Create AVD and generate snapshot
if: steps.avd-cache.outputs.cache-hit != 'true'
uses: reactivecircus/android-emulator-runner@v2
with:
api-level: ${{ matrix.api-level }}
arch: x86_64
target: google_apis
ram-size: 4096M
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."

# Run the actual tests
- name: Run instrumentation tests
uses: reactivecircus/android-emulator-runner@v2
with:
api-level: ${{ matrix.api-level }}
cores: 3
emulator-options: -no-window -gpu swiftshader_indirect -noaudio -no-boot-anim -camera-back none -no-snapshot
disable-animations: true
ram-size: 4096M
target: google_apis
arch: x86_64
target: google_apis
ram-size: 4096M
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: ./gradlew :samples:${{ matrix.sample }}:connectedDebugAndroidTest --no-daemon --stacktrace -PuseKsp=true

- name: Publish test results
Expand Down

0 comments on commit 886b6e4

Please sign in to comment.