mirror of
https://github.com/bryanthaboi/gen1recomp.git
synced 2026-08-12 08:21:02 +02:00
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:
@@ -120,7 +120,7 @@ jobs:
|
|||||||
echo "changed=true" >> "$GITHUB_OUTPUT"
|
echo "changed=true" >> "$GITHUB_OUTPUT"
|
||||||
exit 0
|
exit 0
|
||||||
fi
|
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"
|
echo "changed=true" >> "$GITHUB_OUTPUT"
|
||||||
else
|
else
|
||||||
echo "changed=false" >> "$GITHUB_OUTPUT"
|
echo "changed=false" >> "$GITHUB_OUTPUT"
|
||||||
|
|||||||
@@ -132,8 +132,9 @@ Switch packaging has three automated surfaces (same policy as AD-010):
|
|||||||
### Path-gated PR / push CI (`.github/workflows/ci.yml`)
|
### Path-gated PR / push CI (`.github/workflows/ci.yml`)
|
||||||
|
|
||||||
When a change touches Switch packaging paths
|
When a change touches Switch packaging paths
|
||||||
(`scripts/build_switch.sh`, `scripts/switch/**`, `docs/switch-build.md`, or the
|
(`scripts/build_switch.sh`, `scripts/switch/**`, `docs/switch-build.md`,
|
||||||
Switch-related workflow YAML), CI runs:
|
`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):
|
1. **Offline selftest** on `ubuntu-latest` (forks **and** the canonical repo):
|
||||||
`scripts/switch/selftest_build_switch.sh`,
|
`scripts/switch/selftest_build_switch.sh`,
|
||||||
|
|||||||
@@ -65,6 +65,7 @@ run_tier() {
|
|||||||
|
|
||||||
# ------- ROM-free tiers: these are what CI runs
|
# ------- 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 "T1/T2 engine invariants + parity gates" "$LUA" tests/run_engine.lua
|
||||||
run_tier "T4 mod-SDK" "$LUA" tests/run_modkit.lua
|
run_tier "T4 mod-SDK" "$LUA" tests/run_modkit.lua
|
||||||
|
|
||||||
|
|||||||
@@ -22,9 +22,9 @@ local function mustNotContain(body, needle, label)
|
|||||||
label .. " must not contain " .. string.format("%q", needle))
|
label .. " must not contain " .. string.format("%q", needle))
|
||||||
end
|
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 =
|
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 ci = read(".github/workflows/ci.yml")
|
||||||
local release = read(".github/workflows/release.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, "CI vs release", "README.md")
|
||||||
mustContain(readme, "switch-build.md", "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) ---
|
-- --- SWCI-08: release Switch hard-fail (no continue-on-error on build/stage) ---
|
||||||
do
|
do
|
||||||
local start = release:find("- name: Build Switch", 1, true)
|
local start = release:find("- name: Build Switch", 1, true)
|
||||||
|
|||||||
Reference in New Issue
Block a user