From caf50ec13ad4b1d802bd92622f4865254173f44d Mon Sep 17 00:00:00 2001 From: Stefano Date: Tue, 11 Jul 2023 16:39:43 +0200 Subject: [PATCH] Cache Android test emulators (#2831) * android emulators used for tests are now cached --- .github/workflows/agp-matrix.yml | 33 ++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) diff --git a/.github/workflows/agp-matrix.yml b/.github/workflows/agp-matrix.yml index 11e7bfe7c7..924da61b4c 100644 --- a/.github/workflows/agp-matrix.yml +++ b/.github/workflows/agp-matrix.yml @@ -16,6 +16,30 @@ jobs: with: access_token: ${{ github.token }} + cache-avd: + runs-on: macos-latest + steps: + - name: AVD cache + uses: actions/cache@v3 + id: avd-cache + with: + path: | + ~/.android/avd/* + ~/.android/adb* + key: aosp_atd + + - name: create AVD and generate snapshot for caching + if: steps.avd-cache.outputs.cache-hit != 'true' + uses: reactivecircus/android-emulator-runner@d94c3fbe4fe6a29e4a5ba47c12fb47677c73656b # pin@v2 + with: + api-level: 30 + force-avd-creation: false + emulator-options: -no-window -gpu swiftshader_indirect -noaudio -no-boot-anim -camera-back none + disable-animations: true + target: 'aosp_atd' + channel: canary # Necessary for ATDs + script: echo "Generated AVD snapshot for caching." + agp-matrix-compatibility: timeout-minutes: 30 runs-on: macos-latest @@ -52,6 +76,15 @@ jobs: - name: Make stop run: make stop + - name: AVD cache + uses: actions/cache@v3 + id: avd-cache + with: + path: | + ~/.android/avd/* + ~/.android/adb* + key: aosp_atd + - name: Run instrumentation tests uses: reactivecircus/android-emulator-runner@d94c3fbe4fe6a29e4a5ba47c12fb47677c73656b # pin@v2 with: