Skip to content

Commit cb52574

Browse files
committed
build: add avd caching
1 parent 1572a2e commit cb52574

1 file changed

Lines changed: 25 additions & 1 deletion

File tree

.github/workflows/e2e-tests.yml

Lines changed: 25 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,6 +109,30 @@ jobs:
109109
sudo udevadm trigger --name-match=kvm
110110
ls /dev/kvm
111111
112+
- name: AVD cache
113+
uses: actions/cache@v4
114+
id: avd-cache
115+
with:
116+
path: |
117+
~/.android/avd/*
118+
~/.android/adb*
119+
key: avd-35
120+
121+
- name: Create AVD and generate snapshot for caching
122+
if: steps.avd-cache.outputs.cache-hit != 'true'
123+
uses: reactivecircus/android-emulator-runner@v2
124+
with:
125+
api-level: 35
126+
arch: x86_64
127+
profile: pixel_7
128+
disk-size: 1G
129+
heap-size: 1G
130+
force-avd-creation: false
131+
avd-name: Pixel_8_API_35
132+
disable-animations: true
133+
emulator-options: -no-window -gpu swiftshader_indirect -noaudio -no-boot-anim -camera-back none
134+
script: echo "Generated AVD snapshot for caching."
135+
112136
- name: Run E2E tests
113137
uses: reactivecircus/android-emulator-runner@v2
114138
with:
@@ -121,7 +145,7 @@ jobs:
121145
force-avd-creation: false
122146
avd-name: Pixel_8_API_35
123147
disable-animations: true
124-
emulator-options: -no-window -gpu swiftshader_indirect -noaudio -no-boot-anim -camera-back none
148+
emulator-options: -no-snapshot-save -no-window -gpu swiftshader_indirect -noaudio -no-boot-anim -camera-back none
125149
script: |
126150
adb install -r "./app/build/outputs/apk/debug/app-debug.apk"
127151
pnpm nx run @react-native-harness/${{ matrix.app }}:start --args="test android"

0 commit comments

Comments
 (0)