From 3799e0c3a8f254b514a9c264f6edab6276abe3c1 Mon Sep 17 00:00:00 2001 From: DKChan <524912269@qq.com> Date: Thu, 8 Oct 2026 05:56:04 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D:=20=E5=8D=A1=E2=91=A2T1?= =?UTF-8?q?=E2=80=94=E2=80=94tests.yml=20=E6=B3=A8=E9=87=8A=E6=8E=A2?= =?UTF-8?q?=E9=92=88=E6=AE=B5=E8=A7=A3=E5=B0=81=E6=94=B9=E5=86=99=E4=B8=BA?= =?UTF-8?q?=E6=AD=A3=E5=BC=8F=E8=BD=BB=E9=97=B8=E6=AE=B5=EF=BC=88=E4=B8=89?= =?UTF-8?q?=E6=8E=A2=E9=92=88=20input/struct/contrast=3Dprobe=5Fgate=20?= =?UTF-8?q?=E9=BB=98=E8=AE=A4=E6=AE=B5=E5=90=8C=E6=AC=BE=20Linux=20?= =?UTF-8?q?=E7=8B=AC=E7=AB=8B=E5=BD=A2=E6=80=81=EF=BC=9Atimeout=20120s=20?= =?UTF-8?q?=E5=A4=96=E5=A3=B3+=E9=80=80=E5=87=BA=E7=A0=81=20124/137=20?= =?UTF-8?q?=E8=B6=85=E6=97=B6=E5=88=A4+PASS=20=E4=B8=B2=E5=88=A4=E5=AE=9A?= =?UTF-8?q?=E5=8F=8C=E5=88=A4=E5=AE=9A=E9=95=9C=E5=83=8F=20probe=5Fgate?= =?UTF-8?q?=EF=BC=9B=E5=86=B7=E6=A3=80=E5=87=BA=20--import=20=E5=AF=BC?= =?UTF-8?q?=E5=85=A5=E6=AD=A5=20300s=20=E5=89=8D=E7=BD=AE=E5=86=92?= =?UTF-8?q?=E7=83=9F=E4=B9=8B=E5=89=8D=EF=BC=9B=E8=A7=A6=E5=8F=91=E5=88=86?= =?UTF-8?q?=E6=94=AF=E4=B8=A4=E5=A4=84=20[main]=E2=86=92[master]=20?= =?UTF-8?q?=E4=BF=AE=E6=AD=BB=E8=A7=92=EF=BC=9B=E5=A4=B4=E6=B3=A8=E9=87=8A?= =?UTF-8?q?=E8=BF=BD=E5=8A=A0=E8=BF=9C=E7=AB=AF=E5=B0=B1=E7=BB=AA=E5=8D=B3?= =?UTF-8?q?=E8=87=AA=E5=8A=A8=E7=94=9F=E6=95=88=E5=8F=A5=EF=BC=9B=E6=8E=A2?= =?UTF-8?q?=E9=92=88=E6=97=A5=E5=BF=97=E8=90=BD=20logs/probe=5Fci/=20?= =?UTF-8?q?=E9=A1=BA=E7=8E=B0=E6=9C=89=20artifact=20=E6=AE=B5=E9=9B=B6?= =?UTF-8?q?=E6=94=B9=E5=B9=B6=E5=85=A5=EF=BC=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/tests.yml | 43 ++++++++++++++++++++++++++++++------- 1 file changed, 35 insertions(+), 8 deletions(-) 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()