Skip to content

Commit

Permalink
chore: Try updating CI workflow for instrumentation tests
Browse files Browse the repository at this point in the history
  • Loading branch information
devinbileck committed Jan 31, 2024
1 parent 912b2d3 commit bed269a
Showing 1 changed file with 11 additions and 26 deletions.
37 changes: 11 additions & 26 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ jobs:
timeout-minutes: 30
needs: unit-tests
strategy:
fail-fast: true
fail-fast: false
matrix:
api-level: [ 26, 27, 28, 29, 30, 31, 32, 33, 34 ]
steps:
Expand Down Expand Up @@ -151,48 +151,33 @@ jobs:
sudo udevadm control --reload-rules
sudo udevadm trigger --name-match=kvm
# API 30+ emulators only have x86_64 system images
- name: Get AVD info
uses: ./.github/actions/get-avd-info
id: avd-info
with:
api-level: ${{ matrix.api-level }}

# Retrieve the cached emulator snapshot
- name: Retrieve cached emulator snapshot
uses: actions/cache@9b0c1fce7a93df8e3bb8926b0d6e9d89e92f20a7
- name: AVD cache
uses: actions/cache@v4
id: avd-cache
with:
path: |
~/.android/avd/*
~/.android/adb*
key: ${{ runner.os }}-avd-${{ env.CACHE_VERSION }}-${{ steps.avd-info.outputs.arch }}-${{ steps.avd-info.outputs.target }}-${{ matrix.api-level }}
key: avd-${{ matrix.api-level }}

# Create a new emulator snapshot if it isn't present in the cache
- name: Create AVD snapshot
- name: Create AVD and generate snapshot for caching
if: steps.avd-cache.outputs.cache-hit != 'true'
uses: reactivecircus/android-emulator-runner@d7b53ddc6e44254e1f4cf4a6ad67345837027a66
uses: reactivecircus/android-emulator-runner@v2
with:
api-level: ${{ matrix.api-level }}
arch: ${{ steps.avd-info.outputs.arch }}
target: ${{ steps.avd-info.outputs.target }}
disable-animations: false
force-avd-creation: false
ram-size: 4096M
emulator-options: -no-window -gpu swiftshader_indirect -noaudio -no-boot-anim -camera-back none
script: echo "Generated AVD snapshot"
disable-animations: false
script: echo "Generated AVD snapshot for caching."

- name: Run instrumentation tests
uses: reactivecircus/android-emulator-runner@d7b53ddc6e44254e1f4cf4a6ad67345837027a66
uses: reactivecircus/android-emulator-runner@v2
with:
api-level: ${{ matrix.api-level }}
arch: ${{ steps.avd-info.outputs.arch }}
target: ${{ steps.avd-info.outputs.target }}
disable-animations: true
force-avd-creation: false
ram-size: 4096M
emulator-options: -no-snapshot-save -no-window -gpu swiftshader_indirect -noaudio -no-boot-anim -camera-back none
script: mv .github/debug.keystore ~/.android; ./gradlew connectedCheck
disable-animations: true
script: ./gradlew connectedCheck

- name: Upload reports
uses: actions/upload-artifact@83fd05a356d7e2593de66fc9913b3002723633cb
Expand Down

0 comments on commit bed269a

Please sign in to comment.