Skip to content

Commit 6ba4b46

Browse files
committed
Add Android instrumentation test on emulator
1 parent 7493aae commit 6ba4b46

File tree

2 files changed

+16
-0
lines changed

2 files changed

+16
-0
lines changed

.github/workflows/android.yml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,16 @@ jobs:
8585
# avoid permission issue
8686
sudo chown -R "${USER}" /opt/android
8787
88+
- name: Download Artifacts
89+
shell: bash
90+
run: |
91+
set -eux
92+
curl -O https://gha-artifacts.s3.amazonaws.com/${{ github.repository }}/${{ github.run_id }}/artifacts/llm_demo/app-debug-androidTest.apk
93+
# TODO: Either export, or use persistent storage
94+
curl -O https://gha-artifacts.s3.amazonaws.com/${{ github.repository }}/11395155337/artifacts/stories110M_xnnpack/model.zip
95+
unzip model.zip
96+
mv *.pte model.pte
97+
8898
- name: Gradle cache
8999
uses: gradle/actions/setup-gradle@v3
90100

build/run_android_emulator.sh

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,3 +20,9 @@ $ADB_PATH devices
2020

2121
# TODO: Run tests on emulator here, atm the script only boots up the emulator
2222
# and exits without doing anything yet
23+
adb install -t app-debug-androidTest.apk
24+
25+
adb shell mkdir -p /data/local/tmp/llama
26+
adb push model.pte /data/local/tmp/llama
27+
adb push tokenizer.bin /data/local/tmp/llama
28+
adb shell am instrument -w -r com.example.executorchllamademo.test/androidx.test.runner.AndroidJUnitRunner

0 commit comments

Comments
 (0)