Skip to content

Commit caf50ec

Browse files
authored
Cache Android test emulators (#2831)
* android emulators used for tests are now cached
1 parent 2186444 commit caf50ec

File tree

1 file changed

+33
-0
lines changed

1 file changed

+33
-0
lines changed

.github/workflows/agp-matrix.yml

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,30 @@ jobs:
1616
with:
1717
access_token: ${{ github.token }}
1818

19+
cache-avd:
20+
runs-on: macos-latest
21+
steps:
22+
- name: AVD cache
23+
uses: actions/cache@v3
24+
id: avd-cache
25+
with:
26+
path: |
27+
~/.android/avd/*
28+
~/.android/adb*
29+
key: aosp_atd
30+
31+
- name: create AVD and generate snapshot for caching
32+
if: steps.avd-cache.outputs.cache-hit != 'true'
33+
uses: reactivecircus/android-emulator-runner@d94c3fbe4fe6a29e4a5ba47c12fb47677c73656b # pin@v2
34+
with:
35+
api-level: 30
36+
force-avd-creation: false
37+
emulator-options: -no-window -gpu swiftshader_indirect -noaudio -no-boot-anim -camera-back none
38+
disable-animations: true
39+
target: 'aosp_atd'
40+
channel: canary # Necessary for ATDs
41+
script: echo "Generated AVD snapshot for caching."
42+
1943
agp-matrix-compatibility:
2044
timeout-minutes: 30
2145
runs-on: macos-latest
@@ -52,6 +76,15 @@ jobs:
5276
- name: Make stop
5377
run: make stop
5478

79+
- name: AVD cache
80+
uses: actions/cache@v3
81+
id: avd-cache
82+
with:
83+
path: |
84+
~/.android/avd/*
85+
~/.android/adb*
86+
key: aosp_atd
87+
5588
- name: Run instrumentation tests
5689
uses: reactivecircus/android-emulator-runner@d94c3fbe4fe6a29e4a5ba47c12fb47677c73656b # pin@v2
5790
with:

0 commit comments

Comments
 (0)