diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index f0d2b40a7..6cfe758ad 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -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: |