ci(switch): run workflow content gate in headless suite

Path-gate the Lua gate file and invoke it from scripts/test.sh T0.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
Andrew Quenehen
2026-08-02 22:08:15 -03:00
parent 0a2ef854e6
commit 228306f883
4 changed files with 13 additions and 5 deletions
+1 -1
View File
@@ -120,7 +120,7 @@ jobs:
echo "changed=true" >> "$GITHUB_OUTPUT"
exit 0
fi
if git diff --name-only "$BASE_SHA" "$HEAD_SHA" | grep -Eq '^(scripts/build_switch\.sh$|scripts/switch/|docs/switch-build\.md$|\.github/workflows/(ci|release|switch-artifact-comment)\.yml$)'; then
if git diff --name-only "$BASE_SHA" "$HEAD_SHA" | grep -Eq '^(scripts/build_switch\.sh$|scripts/switch/|docs/switch-build\.md$|tests/switch_ci_workflows_test\.lua$|\.github/workflows/(ci|release|switch-artifact-comment)\.yml$)'; then
echo "changed=true" >> "$GITHUB_OUTPUT"
else
echo "changed=false" >> "$GITHUB_OUTPUT"
+3 -2
View File
@@ -132,8 +132,9 @@ Switch packaging has three automated surfaces (same policy as AD-010):
### Path-gated PR / push CI (`.github/workflows/ci.yml`)
When a change touches Switch packaging paths
(`scripts/build_switch.sh`, `scripts/switch/**`, `docs/switch-build.md`, or the
Switch-related workflow YAML), CI runs:
(`scripts/build_switch.sh`, `scripts/switch/**`, `docs/switch-build.md`,
`tests/switch_ci_workflows_test.lua`, or the Switch-related workflow YAML), CI
runs:
1. **Offline selftest** on `ubuntu-latest` (forks **and** the canonical repo):
`scripts/switch/selftest_build_switch.sh`,
+1
View File
@@ -65,6 +65,7 @@ run_tier() {
# ------- ROM-free tiers: these are what CI runs
run_tier "T0 switch CI workflow content gate" "$LUA" tests/switch_ci_workflows_test.lua
run_tier "T1/T2 engine invariants + parity gates" "$LUA" tests/run_engine.lua
run_tier "T4 mod-SDK" "$LUA" tests/run_modkit.lua
+8 -2
View File
@@ -22,9 +22,9 @@ local function mustNotContain(body, needle, label)
label .. " must not contain " .. string.format("%q", needle))
end
-- Exact path regex contract from design.md (SWCI-01 / 4A).
-- Exact path regex contract (SWCI-01 / 4A + SWFIX-03 test path).
local SWITCH_PATH_REGEX =
[[^(scripts/build_switch\.sh$|scripts/switch/|docs/switch-build\.md$|\.github/workflows/(ci|release|switch-artifact-comment)\.yml$)]]
[[^(scripts/build_switch\.sh$|scripts/switch/|docs/switch-build\.md$|tests/switch_ci_workflows_test\.lua$|\.github/workflows/(ci|release|switch-artifact-comment)\.yml$)]]
local ci = read(".github/workflows/ci.yml")
local release = read(".github/workflows/release.yml")
@@ -136,6 +136,12 @@ mustContain(development, "selftest_build_switch.sh", "switch-development.md")
mustContain(readme, "CI vs release", "README.md")
mustContain(readme, "switch-build.md", "README.md")
-- --- SWFIX-03: headless suite also runs the content gate ---
local test_sh = read("scripts/test.sh")
mustContain(test_sh, "tests/switch_ci_workflows_test.lua", "scripts/test.sh")
mustContain(test_sh, "T0 switch CI workflow content gate", "scripts/test.sh")
mustContain(build_doc, "tests/switch_ci_workflows_test.lua", "switch-build.md path list")
-- --- SWCI-08: release Switch hard-fail (no continue-on-error on build/stage) ---
do
local start = release:find("- name: Build Switch", 1, true)