Merge pull request #3982 from kiwix/Fixes#3978

Re-enabled the emulator caching in CI.
This commit is contained in:
Kelson 2024-09-05 04:39:38 +00:00 committed by GitHub
commit 9ba28ecd90
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -43,6 +43,33 @@ jobs:
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 }}
target: default
arch: x86_64
profile: pixel_2
ram-size: 3072M
force-avd-creation: false
sdcard-path-or-size: 1024M
cores: 4
disable-animations: false
heap-size: 512M
emulator-options: -no-window -gpu swiftshader_indirect -noaudio -no-boot-anim -camera-back none
channel: canary
script: echo "Generated AVD snapshot for caching."
- name: create instrumentation coverage
uses: reactivecircus/android-emulator-runner@v2
env:
@ -52,10 +79,12 @@ jobs:
target: default
arch: x86_64
profile: pixel_2
ram-size: 4096M
ram-size: 3072M
cores: 4
sdcard-path-or-size: 2048M
emulator-options: -no-snapshot-save -no-window -gpu swiftshader_indirect -noaudio -no-boot-anim -camera-back none
sdcard-path-or-size: 1024M
disable-animations: true
force-avd-creation: false
heap-size: 512M
emulator-boot-timeout: 1200
script: bash contrib/instrumentation.sh
@ -71,8 +100,10 @@ jobs:
profile: pixel_2
ram-size: 3072M
cores: 4
sdcard-path-or-size: 1024M
emulator-options: -no-snapshot-save -no-window -gpu swiftshader_indirect -noaudio -no-boot-anim -camera-back none
disable-animations: true
force-avd-creation: false
sdcard-path-or-size: 1024M
emulator-boot-timeout: 1200
heap-size: 512M
script: bash contrib/instrumentation-customapps.sh
@ -86,18 +117,18 @@ jobs:
path: screencap.png
- name: create unit coverage
if: ${{ matrix.api-level==25 }}
if: ${{ matrix.api-level==30 }}
run: ./gradlew testDebugUnitTest testCustomexampleDebugUnitTest
- name: Upload coverage to Codecov
if: ${{ matrix.api-level==25 }}
if: ${{ matrix.api-level==30 }}
uses: codecov/codecov-action@v3
with:
token: ${{ secrets.CODECOV_TOKEN }}
- name: Upload Coverage to GH-Actions
uses: actions/upload-artifact@v3
if: ${{ matrix.api-level==25 }}
if: ${{ matrix.api-level==30 }}
with:
name: Tests Coverage Report
path: |