diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 2ae4487d..682edabb 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -1,15 +1,19 @@ name: Automated Tests -# 注意:仓库已初始化 git(尚无远端)——本 workflow 在首次 push 到 GitHub 后自动生效。 +# 注意:仓库已初始化 git(尚无远端)——本 workflow 在首次 push 到 GitHub 后自动生效;远端仓库建好后无需改本文件即自动生效。 # 载体 = ADR-0004(双载体):逻辑冒烟 + 场景探针;gdUnit4 deferred(不使用 gdUnit4-action)。 # 外部 wall-clock 超时(timeout 命令)为 ADR-0004 硬性要求——引擎自身无死锁探测。 # 路径口径:2026-09-27 三层收敛(7f24b640)后工程在 game/——tests 归 game/tests/、探针在 game/smoke/。 +# 轻闸探针口径(2026-10-08 CI 预接线批/迭代19卡③):三探针=ui_input/ui_struct/ui_contrast +# (tools/probe_gate.sh 默认段同款);ui_probe/ui_click/ui_tune/t17_defer/fx 归 --full 重闸不入轻 CI; +# 窗口化四件(shot/fx_shot/board_shot/ui_audit)禁入 headless CI(无渲染面、探针内 fail-fast); +# 判定=timeout 外壳+退出码超时判+PASS 串判定,镜像 probe_gate 判定逻辑的 Linux 形态。 on: push: - branches: [main] + branches: [master] pull_request: - branches: [main] + branches: [master] jobs: static-scan: @@ -34,15 +38,38 @@ jobs: with: version: 4.7.2 + # 冷检出导入(.godot 不入 git,fresh checkout 首跑一次性付清;probe_gate 本机经验 1-2 分钟) + - name: Import assets (cold checkout, one-time) + run: timeout 300s godot --headless --path game --import + # 逻辑冒烟(run_all.gd 内登记套件 manifest) - name: Run smoke runner (external timeout per ADR-0004) run: timeout 120s godot --headless --path game --script res://tests/run_all.gd - # 场景探针(逐条登记,示例形态): - # - name: Run UI probes - # run: | - # timeout 60s godot --headless --path game res://smoke/ui_probe.tscn - # timeout 60s godot --headless --path game res://smoke/ui_click_probe.tscn + # 场景探针(轻闸三探针=probe_gate 默认段同款;probe_gate.sh 本体系 Windows 专用 + # 〔PowerShell+taskkill〕CI 不可调用,此处为其判定逻辑的 Linux 独立命令形态: + # 每探针 timeout 外壳 + 退出码超时判〔124/137=挂死〕+ PASS 串判定〔只跑不判=违 ADR-0004〕; + # 三探针全跑不短路,末尾按汇总退出码定段红绿) + - name: Run scene probes (light-gate trio, timeout + PASS check per ADR-0004) + run: | + mkdir -p logs/probe_ci + run_probe() { + name="$1"; scene="$2" + echo "======== $name ========" + st=0 + timeout 120s godot --headless --path game "res://smoke/$scene" >"logs/probe_ci/$name.log" 2>&1 || st=$? + tail -n 20 "logs/probe_ci/$name.log" + if [ "$st" -eq 124 ] || [ "$st" -eq 137 ]; then + echo "[ci-probe] FAIL — $name 超时挂死(exit=$st)"; return 1 + elif ! grep -q "PASS" "logs/probe_ci/$name.log"; then + echo "[ci-probe] FAIL — $name 未见 PASS(exit=$st)"; return 1 + fi + } + rc=0 + run_probe ui_input_probe ui_input_probe.tscn || rc=1 + run_probe ui_struct_probe ui_struct_probe.tscn || rc=1 + run_probe ui_contrast_probe ui_contrast_probe.tscn || rc=1 + exit $rc - name: Upload Test Results if: always()