fix(ci): use temp script file to avoid sh -c quoting issues with CUA dispatch

This commit is contained in:
Dennis V
2026-06-24 07:07:29 +00:00
parent 1f59602fce
commit 00409c71b4

View File

@@ -260,6 +260,22 @@ jobs:
echo "MODEL_CAPABLE=$CAPABLE" >> "$GITHUB_OUTPUT" echo "MODEL_CAPABLE=$CAPABLE" >> "$GITHUB_OUTPUT"
echo "opencode model-capable in CI: $CAPABLE" echo "opencode model-capable in CI: $CAPABLE"
- name: Write CUA runner script
run: |
cat > /tmp/cua-runner.sh << 'RUNNEREOF'
#!/bin/sh
# Generated by CI workflow — dispatches to the right CUA mode.
set -e
if [ "${CUA_SCENARIO}" = "e2e" ]; then
exec python3 scripts/android-cua-smoke.py --e2e --model gpt-5.4 --include-xml --opencode-url "${OPENCODE_URL}"
elif [ -n "${CUA_QUERY}" ]; then
exec python3 scripts/android-cua-smoke.py --query "${CUA_QUERY}" --model gpt-5.4 --include-xml --opencode-url "${OPENCODE_URL}" --eval-output /tmp/cua_eval_report.json
else
exec python3 scripts/android-cua-smoke.py --showcase --model gpt-5.4 --include-xml --opencode-url "${OPENCODE_URL}"
fi
RUNNEREOF
chmod +x /tmp/cua-runner.sh
- name: Run CUA smoke test with emulator - name: Run CUA smoke test with emulator
uses: reactivecircus/android-emulator-runner@v2 uses: reactivecircus/android-emulator-runner@v2
env: env:
@@ -277,22 +293,15 @@ jobs:
disable-animations: true disable-animations: true
emulator-boot-timeout: 600 emulator-boot-timeout: 600
emulator-options: -no-window -no-audio -no-boot-anim -gpu swiftshader_indirect -no-snapshot emulator-options: -no-window -no-audio -no-boot-anim -gpu swiftshader_indirect -no-snapshot
# NOTE: android-emulator-runner runs this script with /usr/bin/sh (dash). # NOTE: android-emulator-runner action wraps script content in
# NOTE: Keep the script flat — the action wraps it in sh -c. # sh -c "..." which breaks when inner " chars appear. Use a
# if/elif/fi broke previously due to default-value quoting in GH # temp shell script to avoid quoting conflicts entirely.
# expressions. The env vars are now clean; shell branching works.
script: | script: |
adb shell pm clear cc.agentlabs.opencode || true adb shell pm clear cc.agentlabs.opencode || true
adb install android/app/build/outputs/apk/release/app-release.apk adb install android/app/build/outputs/apk/release/app-release.apk
adb shell am start -n cc.agentlabs.opencode/.MainActivity adb shell am start -n cc.agentlabs.opencode/.MainActivity
sleep 5 sleep 5
if [ "${CUA_SCENARIO}" = "e2e" ]; then sh /tmp/cua-runner.sh
python3 scripts/android-cua-smoke.py --e2e --model gpt-5.4 --include-xml --opencode-url "${OPENCODE_URL}"
elif [ -n "${CUA_QUERY}" ]; then
python3 scripts/android-cua-smoke.py --query "${CUA_QUERY}" --model gpt-5.4 --include-xml --opencode-url "${OPENCODE_URL}" --eval-output /tmp/cua_eval_report.json
else
python3 scripts/android-cua-smoke.py --showcase --model gpt-5.4 --include-xml --opencode-url "${OPENCODE_URL}"
fi
- name: opencode server log - name: opencode server log
if: always() if: always()