fix(ci): enable KVM and fix emulator boot in CUA smoke test

- Enable KVM for hardware acceleration (required for x86_64 emulator)
- Use nohup for emulator process to prevent terminal association issues
- Add avdmanager list to verify AVD creation
- Include platform-tools in sdkmanager install
- Increase boot timeout to 180s
- Upload emulator.log as artifact for debugging
- Reduce job timeout to 45min (was 60)

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
This commit is contained in:
engineer
2026-05-28 00:23:56 -07:00
parent 7ec3461304
commit e3384677bc

View File

@@ -14,7 +14,7 @@ on:
jobs:
cua-test:
runs-on: ubuntu-latest
timeout-minutes: 60
timeout-minutes: 45
steps:
- uses: actions/checkout@v6
@@ -31,8 +31,11 @@ jobs:
- name: Setup Android SDK
uses: android-actions/setup-android@v4
- name: Add emulator to PATH
run: echo "$ANDROID_HOME/emulator" >> $GITHUB_PATH
- name: Enable KVM
run: |
echo 'KERNEL=="kvm", GROUP="kvm", MODE="0666", OPTIONS+="static_node=kvm"' | sudo tee /etc/udev/rules.d/99-kvm4all.rules
sudo udevadm control --reload-rules
sudo udevadm trigger --name-match=kvm
- name: Cache Gradle
uses: actions/cache@v5
@@ -47,14 +50,17 @@ jobs:
- name: Install Android system image & create AVD
run: |
sdkmanager "system-images;android-34;google_apis;x86_64" "emulator"
sdkmanager "system-images;android-34;google_apis;x86_64" "emulator" "platform-tools"
echo "no" | avdmanager create avd -n test -k "system-images;android-34;google_apis;x86_64" --force
avdmanager list avd
- name: Start emulator
run: |
emulator -avd test -no-window -no-audio -no-boot-anim -gpu swiftshader_indirect -no-snapshot &
nohup emulator -avd test -no-window -no-audio -no-boot-anim -gpu swiftshader_indirect -no-snapshot -port 5554 > /tmp/emulator.log 2>&1 &
adb wait-for-device
timeout 120 bash -c 'while [ "$(adb shell getprop sys.boot_completed 2>/dev/null)" != "1" ]; do sleep 2; done'
timeout 180 bash -c 'while [ "$(adb shell getprop sys.boot_completed 2>/dev/null)" != "1" ]; do sleep 3; done'
echo "Emulator booted successfully"
adb shell getprop ro.build.version.sdk
- name: Install dependencies & build APK
run: |
@@ -95,4 +101,5 @@ jobs:
path: |
/tmp/cua_*.png
/tmp/cua_*.mp4
/tmp/emulator.log
if-no-files-found: ignore