Skip to content

Commit

Permalink
ci: use fresh AVD from benchmark tests (#157)
Browse files Browse the repository at this point in the history
  • Loading branch information
CAMOBAP authored Jul 3, 2024
1 parent efd18b2 commit 124caaa
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
9 changes: 7 additions & 2 deletions .github/actions/android-emulator-run/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,16 @@ inputs:
description: Emulator boot options
required: true
default: -no-window -gpu swiftshader_indirect -noaudio -no-boot-anim -camera-back none
fresh-avd:
description: Force AVD creation and skip cache
required: false
default: 'false'

runs:
using: "composite"
steps:
- name: Cache AVD
if: inputs.fresh-avd != 'true'
uses: actions/cache@v4
id: avd-cache
with:
Expand All @@ -45,7 +50,7 @@ runs:
sudo udevadm control --reload-rules
sudo udevadm trigger --name-match=kvm
- name: 'Create AVD'
if: steps.avd-cache.outputs.cache-hit != 'true'
if: inputs.fresh-avd != 'true' && steps.avd-cache.outputs.cache-hit != 'true'
uses: reactivecircus/android-emulator-runner@v2
with:
arch: ${{ inputs.arch }}
Expand All @@ -63,6 +68,6 @@ runs:
profile: ${{ inputs.profile }}
api-level: ${{ inputs.api-level }}
emulator-options: ${{ inputs.boot-options }}
force-avd-creation: false
force-avd-creation: ${{ inputs.fresh-avd == 'true' }}
disable-animations: true
script: ${{ inputs.script }}
1 change: 1 addition & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,7 @@ jobs:
uses: ./.github/actions/android-emulator-run
with:
api-level: 29
fresh-avd: true
script: |
adb uninstall com.hcaptcha.sdk.bench.test || true
./gradlew benchmark:connectedReleaseAndroidTest
Expand Down

0 comments on commit 124caaa

Please sign in to comment.