fix(ci): use temp script file to avoid sh -c quoting issues with CUA dispatch
This commit is contained in:
31
.github/workflows/cua-smoke.yml
vendored
31
.github/workflows/cua-smoke.yml
vendored
@@ -260,6 +260,22 @@ jobs:
|
||||
echo "MODEL_CAPABLE=$CAPABLE" >> "$GITHUB_OUTPUT"
|
||||
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
|
||||
uses: reactivecircus/android-emulator-runner@v2
|
||||
env:
|
||||
@@ -277,22 +293,15 @@ jobs:
|
||||
disable-animations: true
|
||||
emulator-boot-timeout: 600
|
||||
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: Keep the script flat — the action wraps it in sh -c.
|
||||
# if/elif/fi broke previously due to default-value quoting in GH
|
||||
# expressions. The env vars are now clean; shell branching works.
|
||||
# NOTE: android-emulator-runner action wraps script content in
|
||||
# sh -c "..." which breaks when inner " chars appear. Use a
|
||||
# temp shell script to avoid quoting conflicts entirely.
|
||||
script: |
|
||||
adb shell pm clear cc.agentlabs.opencode || true
|
||||
adb install android/app/build/outputs/apk/release/app-release.apk
|
||||
adb shell am start -n cc.agentlabs.opencode/.MainActivity
|
||||
sleep 5
|
||||
if [ "${CUA_SCENARIO}" = "e2e" ]; then
|
||||
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
|
||||
sh /tmp/cua-runner.sh
|
||||
|
||||
- name: opencode server log
|
||||
if: always()
|
||||
|
||||
Reference in New Issue
Block a user