- 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>
106 lines
3.5 KiB
YAML
106 lines
3.5 KiB
YAML
name: CUA Smoke Test
|
|
|
|
on:
|
|
workflow_dispatch:
|
|
push:
|
|
branches: [main]
|
|
tags: ["v*"]
|
|
paths:
|
|
- "scripts/android-cua-smoke.py"
|
|
- "src/**"
|
|
- "app/**"
|
|
- ".github/workflows/cua-smoke.yml"
|
|
|
|
jobs:
|
|
cua-test:
|
|
runs-on: ubuntu-latest
|
|
timeout-minutes: 45
|
|
steps:
|
|
- uses: actions/checkout@v6
|
|
|
|
- uses: actions/setup-node@v6
|
|
with:
|
|
node-version: 20
|
|
cache: npm
|
|
|
|
- uses: actions/setup-java@v5
|
|
with:
|
|
distribution: temurin
|
|
java-version: 17
|
|
|
|
- name: Setup Android SDK
|
|
uses: android-actions/setup-android@v4
|
|
|
|
- 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
|
|
with:
|
|
path: |
|
|
~/.gradle/caches
|
|
~/.gradle/wrapper
|
|
android/.gradle
|
|
key: ${{ runner.os }}-gradle-${{ hashFiles('android/**/*.gradle*', 'android/gradle/wrapper/gradle-wrapper.properties') }}
|
|
restore-keys: |
|
|
${{ runner.os }}-gradle-
|
|
|
|
- name: Install Android system image & create AVD
|
|
run: |
|
|
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: |
|
|
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 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: |
|
|
npm install --legacy-peer-deps
|
|
npx expo prebuild --platform android --no-install
|
|
keytool -genkey -v -keystore android/app/debug.keystore -storepass android -alias androiddebugkey -keypass android -keyalg RSA -keysize 2048 -validity 10000 -dname "CN=Android Debug,O=Android,C=US"
|
|
cd android && ./gradlew assembleRelease
|
|
|
|
- name: Install APK on emulator
|
|
run: adb install android/app/build/outputs/apk/release/app-release.apk
|
|
|
|
- name: Launch app
|
|
run: |
|
|
adb shell am start -n ai.opencode.mobile/.MainActivity
|
|
sleep 5
|
|
|
|
- name: Install Python deps
|
|
run: pip install openai
|
|
|
|
- name: Run CUA smoke test
|
|
env:
|
|
AZURE_OPENAI_API_KEY: ${{ secrets.AZURE_OPENAI_API_KEY }}
|
|
AZURE_OPENAI_ENDPOINT: ${{ secrets.AZURE_OPENAI_ENDPOINT }}
|
|
AZURE_OPENAI_API_VERSION: "2024-08-01-preview"
|
|
OPENCODE_URL: "http://100.108.64.76:4096"
|
|
ARCHIVEBOX_URL: ${{ secrets.ARCHIVEBOX_URL }}
|
|
ARCHIVEBOX_API_KEY: ${{ secrets.ARCHIVEBOX_API_KEY }}
|
|
run: |
|
|
python3 scripts/android-cua-smoke.py \
|
|
--model gpt-5.4 \
|
|
--include-xml
|
|
|
|
- name: Upload test artifacts
|
|
if: always()
|
|
uses: actions/upload-artifact@v7
|
|
with:
|
|
name: cua-artifacts-${{ github.run_number }}
|
|
path: |
|
|
/tmp/cua_*.png
|
|
/tmp/cua_*.mp4
|
|
/tmp/emulator.log
|
|
if-no-files-found: ignore
|