Skip to content

Commit 36ba42d

Browse files
Copilotkirklandsign
andcommitted
Address code review: use env variables for cache key and emulator options
Co-authored-by: kirklandsign <107070759+kirklandsign@users.noreply.github.com>
1 parent 5ac3ad4 commit 36ba42d

1 file changed

Lines changed: 7 additions & 5 deletions

File tree

.github/workflows/android-build.yml

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,8 @@ jobs:
6363
path: llm/android/LlamaDemo
6464
env:
6565
API_LEVEL: 34
66+
ARCH: x86_64
67+
EMULATOR_OPTIONS: -no-window -gpu swiftshader_indirect -noaudio -no-boot-anim -camera-back none
6668

6769
name: Instrumentation Test ${{ matrix.name }}
6870
steps:
@@ -91,16 +93,16 @@ jobs:
9193
path: |
9294
~/.android/avd/*
9395
~/.android/adb*
94-
key: avd-${{ env.API_LEVEL }}
96+
key: avd-${{ env.API_LEVEL }}-${{ env.ARCH }}
9597

9698
- name: Create AVD and generate snapshot for caching
9799
if: steps.avd-cache.outputs.cache-hit != 'true'
98100
uses: reactivecircus/android-emulator-runner@v2
99101
with:
100102
api-level: ${{ env.API_LEVEL }}
101-
arch: x86_64
103+
arch: ${{ env.ARCH }}
102104
force-avd-creation: false
103-
emulator-options: -no-window -gpu swiftshader_indirect -noaudio -no-boot-anim -camera-back none
105+
emulator-options: ${{ env.EMULATOR_OPTIONS }}
104106
disable-animations: false
105107
working-directory: ${{ matrix.path }}
106108
script: echo "Generated AVD snapshot for caching."
@@ -109,9 +111,9 @@ jobs:
109111
uses: reactivecircus/android-emulator-runner@v2
110112
with:
111113
api-level: ${{ env.API_LEVEL }}
112-
arch: x86_64
114+
arch: ${{ env.ARCH }}
113115
force-avd-creation: false
114-
emulator-options: -no-snapshot-save -no-window -gpu swiftshader_indirect -noaudio -no-boot-anim -camera-back none
116+
emulator-options: -no-snapshot-save ${{ env.EMULATOR_OPTIONS }}
115117
disable-animations: true
116118
working-directory: ${{ matrix.path }}
117119
script: ./gradlew connectedCheck

0 commit comments

Comments
 (0)