Skip to content

Commit

Permalink
ci: Increase AVD cache key specificity
Browse files Browse the repository at this point in the history
Avoid erroneous cache hits that may result in the CI task hanging
indefinitely while terminating the emulator.
  • Loading branch information
dcalhoun committed Nov 5, 2024
1 parent 0583549 commit 2e892a6
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions .github/workflows/rnmobile-android-runner.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@ jobs:
matrix:
native-test-name: [gutenberg-editor-rendering]
api-level: [29]
target: [default, google_apis]
arch: [x86_64]

steps:
- name: checkout
Expand Down Expand Up @@ -56,28 +58,30 @@ jobs:
path: |
~/.android/avd/*
~/.android/adb*
key: avd-${{ matrix.api-level }}
key: avd-${{ matrix.api-level }}-${{ matrix.target }}-${{ matrix.arch }}

- name: Create AVD and generate snapshot for caching
if: steps.avd-cache.outputs.cache-hit != 'true'
uses: reactivecircus/android-emulator-runner@62dbb605bba737720e10b196cb4220d374026a6d # v2.33.0
with:
api-level: ${{ matrix.api-level }}
target: ${{ matrix.target }}
force-avd-creation: false
emulator-options: -no-window -gpu swiftshader_indirect -noaudio -no-boot-anim -camera-back none
disable-animations: false
arch: x86_64
arch: ${{ matrix.arch }}
profile: Nexus 6
script: echo "Generated AVD snapshot for caching."

- name: Run tests
uses: reactivecircus/android-emulator-runner@62dbb605bba737720e10b196cb4220d374026a6d # v2.33.0
with:
api-level: ${{ matrix.api-level }}
target: ${{ matrix.target }}
force-avd-creation: false
emulator-options: -no-snapshot-save -no-window -gpu swiftshader_indirect -noaudio -no-boot-anim -camera-back none
disable-animations: true
arch: x86_64
arch: ${{ matrix.arch }}
profile: Nexus 6
script: npm run native test:e2e:android:local ${{ matrix.native-test-name }}

Expand Down

0 comments on commit 2e892a6

Please sign in to comment.