From 911df26274ff1f1a8c96a3dff07bef7c153f7c8e Mon Sep 17 00:00:00 2001 From: Federico Iosue Date: Thu, 27 Oct 2022 23:38:10 +0200 Subject: [PATCH] Trying AVD cache to speed up CI https://github.com/ReactiveCircus/android-emulator-runner#usage--examples --- .github/workflows/main.yml | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 93690d17d..d3c96e736 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -15,12 +15,30 @@ jobs: distribution: 'temurin' java-version: 11 cache: 'gradle' + - name: AVD cache + uses: actions/cache@v3 + id: avd-cache + with: + path: | + ~/.android/avd/* + ~/.android/adb* + key: avd-30 + - name: create AVD and generate snapshot for caching + if: steps.avd-cache.outputs.cache-hit != 'true' + uses: reactivecircus/android-emulator-runner@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: false + script: echo "Generated AVD snapshot for caching." - name: Run unit/instrumentation tests and coverage generation uses: reactivecircus/android-emulator-runner@v2 with: api-level: 30 target: google_apis arch: x86_64 + force-avd-creation: false emulator-options: -no-window -gpu swiftshader_indirect -no-snapshot -noaudio -no-boot-anim disable-animations: true script: ./gradlew -Pandroid.testInstrumentationRunnerArguments.notAnnotation=androidx.test.filters.FlakyTest,androidx.test.filters.LargeTest jacocoTestReport --stacktrace