Skip to content

Commit b2e86bc

Browse files
Joseph Coopergrodin
Joseph Cooper
authored andcommitted
ci: Enable caching for AVDs
Note workaround for ReactiveCircus/android-emulator-runner#319
1 parent e8365d3 commit b2e86bc

File tree

2 files changed

+24
-2
lines changed

2 files changed

+24
-2
lines changed

.github/workflows/data-integration-tests.yml

+23-1
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,27 @@ jobs:
4747
with:
4848
cache-read-only: false
4949

50+
- name: AVD cache
51+
uses: actions/cache@v3
52+
id: avd-cache
53+
with:
54+
path: |
55+
~/.android/avd/*
56+
~/.android/adb*
57+
key: avd-${{ matrix.api-level }}-${{ matrix.target }}
58+
59+
- name: create AVD and generate snapshot for caching
60+
if: steps.avd-cache.outputs.cache-hit != 'true'
61+
uses: reactivecircus/android-emulator-runner@v2
62+
with:
63+
profile: "Galaxy Nexus"
64+
api-level: ${{ matrix.api-level }}
65+
target: ${{ matrix.target }}
66+
force-avd-creation: false
67+
emulator-options: -no-window -gpu swiftshader_indirect -noaudio -no-boot-anim -camera-back none
68+
disable-animations: false
69+
script: echo "Generated AVD snapshot for caching."
70+
5071
## Build before running tests
5172
- name: Build instrumented integration tests
5273
uses: gradle/gradle-build-action@v2
@@ -68,7 +89,8 @@ jobs:
6889
force-avd-creation: false
6990
emulator-options: -no-snapshot-save -no-window -gpu swiftshader_indirect -noaudio -no-boot-anim -camera-back none
7091
disable-animations: true
71-
script: ./gradlew :integration-tests:firebase:connectedCheck
92+
# Workaround for https://github.com/ReactiveCircus/android-emulator-runner/issues/319
93+
script: adb uninstall "com.omricat.maplibrarian.integration-testing.debug"; ./gradlew :integration-tests:firebase:connectedCheck
7294

7395
- name: Extract logs from firebase emulator container
7496
if: ${{ always() }}

integration-tests/firebase/build.gradle.kts

+1-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ plugins {
1919
}
2020

2121
android {
22-
namespace = "com.omricat.maplibrarian.integration-testing.debug"
22+
namespace = "com.omricat.maplibrarian.integrationtesting.debug"
2323
targetProjectPath = ":app"
2424

2525
val buildVersions: BuildVersions by rootProject.extra

0 commit comments

Comments
 (0)