Skip to content

Commit c5ee54d

Browse files
xaionaro@dx.centerxaionaro@dx.center
authored andcommitted
Use reactivecircus/android-emulator-runner for E2E tests
Replaces manual sdkmanager/avdmanager/emulator setup with the well-tested android-emulator-runner action which handles system image install, AVD creation, emulator boot, and PATH setup automatically.
1 parent e7d42d8 commit c5ee54d

File tree

1 file changed

+8
-31
lines changed

1 file changed

+8
-31
lines changed

.github/workflows/ci.yml

Lines changed: 8 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -73,41 +73,18 @@ jobs:
7373
sudo udevadm control --reload-rules
7474
sudo udevadm trigger --name-match=kvm
7575
76-
- name: Install Android SDK components and NDK
76+
- name: Install Android NDK
7777
run: |
78-
SDKMANAGER="$ANDROID_HOME/cmdline-tools/latest/bin/sdkmanager"
79-
AVDMANAGER="$ANDROID_HOME/cmdline-tools/latest/bin/avdmanager"
80-
yes | "$SDKMANAGER" --install \
81-
"platform-tools" \
82-
"emulator" \
83-
"system-images;android-35;google_apis;x86_64" \
84-
"platforms;android-35" || true
8578
wget -q "https://dl.google.com/android/repository/android-ndk-${ANDROID_NDK_VERSION}-linux.zip" -O /tmp/ndk.zip
8679
unzip -q /tmp/ndk.zip -d /tmp/ndk-extract/
8780
mkdir -p "$ANDROID_HOME/ndk"
8881
mv /tmp/ndk-extract/android-ndk-* "$ANDROID_HOME/ndk/${ANDROID_NDK_DIR_NAME}"
8982
echo "ANDROID_NDK_HOME=$ANDROID_HOME/ndk/${ANDROID_NDK_DIR_NAME}" >> "$GITHUB_ENV"
9083
91-
- name: Create AVD
92-
run: |
93-
echo "no" | "$ANDROID_HOME/cmdline-tools/latest/bin/avdmanager" create avd \
94-
-n e2e_examples -k "system-images;android-35;google_apis;x86_64" --force
95-
96-
- name: Start emulator
97-
run: |
98-
$ANDROID_HOME/emulator/emulator \
99-
-avd e2e_examples -no-window -no-audio -no-boot-anim \
100-
-gpu swiftshader_indirect -no-metrics &
101-
echo "Waiting for emulator boot..."
102-
adb wait-for-device
103-
for i in $(seq 1 60); do
104-
RESULT=$(adb shell getprop sys.boot_completed 2>/dev/null | tr -d '\r\n')
105-
if [ "$RESULT" = "1" ]; then
106-
echo "Emulator booted after ~$((i*5))s"
107-
break
108-
fi
109-
sleep 5
110-
done
111-
112-
- name: Run examples E2E
113-
run: make e2e-examples
84+
- name: Run examples on emulator
85+
uses: reactivecircus/android-emulator-runner@v2
86+
with:
87+
api-level: 35
88+
target: google_apis
89+
arch: x86_64
90+
script: make e2e-examples

0 commit comments

Comments
 (0)