Skip to content

Commit

Permalink
Cache emulator startup time
Browse files Browse the repository at this point in the history
  • Loading branch information
renanvy committed Aug 8, 2023
1 parent c1c8a53 commit 560c16d
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,25 @@ runs:
- name: Gradle cache
uses: gradle/gradle-build-action@v2

- name: AVD cache
uses: actions/cache@v3
id: avd-cache
with:
path: |
~/.android/avd/*
~/.android/adb*
key: avd-${{ matrix.api-level }

- 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: ${{ matrix.api-level }}
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 tests
if: ${{ inputs.unit_test == 'true' }}
run: ./gradlew test
Expand All @@ -44,6 +63,9 @@ runs:
uses: reactivecircus/android-emulator-runner@v2
if: ${{ inputs.instrumented_test == 'true' }}
with:
force-avd-creation: false
emulator-options: -no-snapshot-save -no-window -gpu swiftshader_indirect -noaudio -no-boot-anim -camera-back none
disable-animations: true
api-level: 29
script: ./gradlew connectedCheck

Expand Down

0 comments on commit 560c16d

Please sign in to comment.