diff --git a/.github/workflows/Build.yaml b/.github/workflows/Build.yaml index 7e5a80eea..4c6dfe51f 100644 --- a/.github/workflows/Build.yaml +++ b/.github/workflows/Build.yaml @@ -236,14 +236,41 @@ jobs: build-scan-terms-of-use-url: "https://gradle.com/terms-of-service" build-scan-terms-of-use-agree: "yes" + - name: AVD cache + uses: actions/cache@v4 + id: avd-cache + with: + path: | + ~/.android/avd/* + ~/.android/adb* + key: avd-${{ matrix.api-level }} + + # Take a snapshot if it doesn't have a cache. + - 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 }} + avd-name: test-${{ matrix.api-level }} + arch: x86_64 + disk-size: 6000M + heap-size: 600M + force-avd-creation: false + disable-animations: false + emulator-options: -no-window -gpu swiftshader_indirect -noaudio -no-boot-anim -camera-back none + script: echo "Generated AVD snapshot for caching." + - name: Build projects and run instrumentation tests uses: reactivecircus/android-emulator-runner@v2 with: api-level: ${{ matrix.api-level }} + avd-name: test-${{ matrix.api-level }} arch: x86_64 - disable-animations: true disk-size: 6000M heap-size: 600M + force-avd-creation: false + disable-animations: true + emulator-options: -no-snapshot-save -no-window -gpu swiftshader_indirect -noaudio -no-boot-anim -camera-back none script: ./gradlew connectedDemoDebugAndroidTest --daemon - name: Run local tests (including Roborazzi) for the combined coverage report (only API 30)