Skip to content

Commit

Permalink
Merge pull request #3982 from kiwix/Fixes#3978
Browse files Browse the repository at this point in the history
Re-enabled the emulator caching in CI.
  • Loading branch information
kelson42 authored Sep 5, 2024
2 parents 829ec53 + 16cbe2a commit 9ba28ec
Showing 1 changed file with 37 additions and 6 deletions.
43 changes: 37 additions & 6 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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
Expand All @@ -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
Expand All @@ -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: |
Expand Down

0 comments on commit 9ba28ec

Please sign in to comment.