Skip to content

Commit e9bff4a

Browse files
authored
Merge pull request #703 from synonymdev/claude/cache-emulator-state-IbYlc
ci: cache emulator AVD for faster E2E boots
2 parents 5064081 + 96fa238 commit e9bff4a

File tree

2 files changed

+50
-6
lines changed

2 files changed

+50
-6
lines changed

.github/workflows/e2e.yml

Lines changed: 25 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -104,6 +104,28 @@ jobs:
104104
sudo udevadm control --reload-rules
105105
sudo udevadm trigger --name-match=kvm
106106
107+
- name: AVD cache
108+
uses: actions/cache@v4
109+
id: avd-cache
110+
with:
111+
path: |
112+
~/.android/avd/*
113+
~/.android/adb*
114+
key: avd-33-x86_64-pixel_6
115+
116+
- name: Create AVD and generate snapshot for caching
117+
if: steps.avd-cache.outputs.cache-hit != 'true'
118+
uses: reactivecircus/android-emulator-runner@v2
119+
with:
120+
profile: pixel_6
121+
api-level: 33
122+
arch: x86_64
123+
avd-name: Pixel_6
124+
force-avd-creation: false
125+
emulator-options: -no-window -gpu swiftshader_indirect -noaudio -no-boot-anim -camera-front none
126+
disable-animations: false
127+
script: echo "Generated AVD snapshot for caching."
128+
107129
- name: Download APK
108130
uses: actions/download-artifact@v4
109131
with:
@@ -156,7 +178,7 @@ jobs:
156178
arch: x86_64
157179
avd-name: Pixel_6
158180
force-avd-creation: false
159-
emulator-options: -no-window -gpu swiftshader_indirect -no-snapshot -noaudio -no-boot-anim -camera-front none
181+
emulator-options: -no-snapshot-save -no-window -gpu swiftshader_indirect -noaudio -no-boot-anim -camera-front none
160182
script: cd bitkit-e2e-tests && ./ci_run_android.sh --mochaOpts.grep "${{ matrix.shard.grep }}"
161183
env:
162184
RECORD_VIDEO: true
@@ -173,7 +195,7 @@ jobs:
173195
arch: x86_64
174196
avd-name: Pixel_6
175197
force-avd-creation: false
176-
emulator-options: -no-window -gpu swiftshader_indirect -no-snapshot -noaudio -no-boot-anim -camera-front none
198+
emulator-options: -no-snapshot-save -no-window -gpu swiftshader_indirect -noaudio -no-boot-anim -camera-front none
177199
script: cd bitkit-e2e-tests && ./ci_run_android.sh --mochaOpts.grep "${{ matrix.shard.grep }}"
178200
env:
179201
RECORD_VIDEO: true
@@ -189,7 +211,7 @@ jobs:
189211
arch: x86_64
190212
avd-name: Pixel_6
191213
force-avd-creation: false
192-
emulator-options: -no-window -gpu swiftshader_indirect -no-snapshot -noaudio -no-boot-anim -camera-front none
214+
emulator-options: -no-snapshot-save -no-window -gpu swiftshader_indirect -noaudio -no-boot-anim -camera-front none
193215
script: cd bitkit-e2e-tests && ./ci_run_android.sh --mochaOpts.grep "${{ matrix.shard.grep }}"
194216
env:
195217
RECORD_VIDEO: true

.github/workflows/e2e_migration.yml

Lines changed: 25 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -108,6 +108,28 @@ jobs:
108108
sudo udevadm control --reload-rules
109109
sudo udevadm trigger --name-match=kvm
110110
111+
- name: AVD cache
112+
uses: actions/cache@v4
113+
id: avd-cache
114+
with:
115+
path: |
116+
~/.android/avd/*
117+
~/.android/adb*
118+
key: avd-33-x86_64-pixel_6
119+
120+
- name: Create AVD and generate snapshot for caching
121+
if: steps.avd-cache.outputs.cache-hit != 'true'
122+
uses: reactivecircus/android-emulator-runner@v2
123+
with:
124+
profile: pixel_6
125+
api-level: 33
126+
arch: x86_64
127+
avd-name: Pixel_6
128+
force-avd-creation: false
129+
emulator-options: -no-window -gpu swiftshader_indirect -noaudio -no-boot-anim -camera-front none
130+
disable-animations: false
131+
script: echo "Generated AVD snapshot for caching."
132+
111133
- name: Download APK
112134
uses: actions/download-artifact@v4
113135
with:
@@ -149,7 +171,7 @@ jobs:
149171
arch: x86_64
150172
avd-name: Pixel_6
151173
force-avd-creation: false
152-
emulator-options: -no-window -gpu swiftshader_indirect -no-snapshot -noaudio -no-boot-anim -camera-front none
174+
emulator-options: -no-snapshot-save -no-window -gpu swiftshader_indirect -noaudio -no-boot-anim -camera-front none
153175
script: cd bitkit-e2e-tests && ./ci_run_android.sh --mochaOpts.grep "${{ matrix.scenario.grep }}"
154176
env:
155177
BACKEND: regtest
@@ -167,7 +189,7 @@ jobs:
167189
arch: x86_64
168190
avd-name: Pixel_6
169191
force-avd-creation: false
170-
emulator-options: -no-window -gpu swiftshader_indirect -no-snapshot -noaudio -no-boot-anim -camera-front none
192+
emulator-options: -no-snapshot-save -no-window -gpu swiftshader_indirect -noaudio -no-boot-anim -camera-front none
171193
script: cd bitkit-e2e-tests && ./ci_run_android.sh --mochaOpts.grep "${{ matrix.scenario.grep }}"
172194
env:
173195
BACKEND: regtest
@@ -184,7 +206,7 @@ jobs:
184206
arch: x86_64
185207
avd-name: Pixel_6
186208
force-avd-creation: false
187-
emulator-options: -no-window -gpu swiftshader_indirect -no-snapshot -noaudio -no-boot-anim -camera-front none
209+
emulator-options: -no-snapshot-save -no-window -gpu swiftshader_indirect -noaudio -no-boot-anim -camera-front none
188210
script: cd bitkit-e2e-tests && ./ci_run_android.sh --mochaOpts.grep "${{ matrix.scenario.grep }}"
189211
env:
190212
BACKEND: regtest

0 commit comments

Comments
 (0)