Skip to content

Commit a443a64

Browse files
committed
Add Android instrumentation test on emulator
1 parent 3b25b05 commit a443a64

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
@@ -66,6 +66,16 @@ jobs:
6666
# avoid permission issue
6767
sudo chown -R "${USER}" /opt/android
6868
69+
- name: Download Artifacts
70+
shell: bash
71+
run: |
72+
set -eux
73+
curl -O https://gha-artifacts.s3.amazonaws.com/${{ github.repository }}/${{ github.run_id }}/artifacts/llm_demo/app-debug-androidTest.apk
74+
# TODO: Either export, or use persistent storage
75+
curl -O https://gha-artifacts.s3.amazonaws.com/${{ github.repository }}/11395155337/artifacts/stories110M_xnnpack/model.zip
76+
unzip model.zip
77+
mv *.pte model.pte
78+
6979
- name: Gradle cache
7080
uses: gradle/actions/setup-gradle@v3
7181

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)