ci(nx): run switch transfer docs gate on Switch path changes

Wire tests/switch_transfer_docs_test.lua into switch-changes detection,
switch-selftest, and the ROM-free T0 lane so docs drift fails CI.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
Andrew Quenehen
2026-08-03 10:01:47 -03:00
parent 54c8d2706b
commit 17843c2f7a
4 changed files with 18 additions and 9 deletions
+3 -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$|tests/switch_ci_workflows_test\.lua$|\.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-.*\.md$|tests/switch_ci_workflows_test\.lua$|tests/switch_transfer_docs_test\.lua$|\.github/workflows/(ci|release|switch-artifact-comment)\.yml$)'; then
echo "changed=true" >> "$GITHUB_OUTPUT"
else
echo "changed=false" >> "$GITHUB_OUTPUT"
@@ -141,6 +141,8 @@ jobs:
run: bash scripts/switch/verify_payload.sh --self-test
- name: Switch CI workflow content gate
run: luajit tests/switch_ci_workflows_test.lua
- name: Switch transfer docs content gate
run: luajit tests/switch_transfer_docs_test.lua
switch-build:
name: Switch fused build
+7 -6
View File
@@ -132,15 +132,16 @@ 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`,
`tests/switch_ci_workflows_test.lua`, or the Switch-related workflow YAML), CI
runs:
When a change touches Switch packaging / Switch docs paths
(`scripts/build_switch.sh`, `scripts/switch/**`, `docs/switch-*.md`,
`tests/switch_ci_workflows_test.lua`, `tests/switch_transfer_docs_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`,
`scripts/switch/verify_payload.sh --self-test`, and
`luajit tests/switch_ci_workflows_test.lua`.
`scripts/switch/verify_payload.sh --self-test`,
`luajit tests/switch_ci_workflows_test.lua`, and
`luajit tests/switch_transfer_docs_test.lua`.
2. **Fused NRO build** only on the **canonical** repository
(`bryanthaboi/gen1recomp`), on the self-hosted Mac runner
(`scripts/build_switch.sh --fetch --fused`), and only when the workflow
+1
View File
@@ -66,6 +66,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 "T0 switch transfer docs gate" "$LUA" tests/switch_transfer_docs_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
+7 -2
View File
@@ -24,7 +24,7 @@ end
-- 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$|tests/switch_ci_workflows_test\.lua$|\.github/workflows/(ci|release|switch-artifact-comment)\.yml$)]]
[[^(scripts/build_switch\.sh$|scripts/switch/|docs/switch-.*\.md$|tests/switch_ci_workflows_test\.lua$|tests/switch_transfer_docs_test\.lua$|\.github/workflows/(ci|release|switch-artifact-comment)\.yml$)]]
local ci = read(".github/workflows/ci.yml")
local release = read(".github/workflows/release.yml")
@@ -45,6 +45,7 @@ mustContain(ci, "needs.switch-changes.outputs.changed == 'true'", "ci.yml")
mustContain(ci, "scripts/switch/selftest_build_switch.sh", "ci.yml")
mustContain(ci, "scripts/switch/verify_payload.sh --self-test", "ci.yml")
mustContain(ci, "luajit tests/switch_ci_workflows_test.lua", "ci.yml")
mustContain(ci, "luajit tests/switch_transfer_docs_test.lua", "ci.yml")
-- switch-selftest must be ubuntu-latest (fork-safe); pin via job block scan
do
@@ -57,6 +58,7 @@ do
mustContain(block, "selftest_build_switch.sh", "switch-selftest")
mustContain(block, "verify_payload.sh --self-test", "switch-selftest")
mustContain(block, "tests/switch_ci_workflows_test.lua", "switch-selftest")
mustContain(block, "tests/switch_transfer_docs_test.lua", "switch-selftest")
mustNotContain(block, "continue-on-error:", "switch-selftest")
end
@@ -152,11 +154,14 @@ 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 ---
-- --- SWFIX-03: headless suite also runs the content gates ---
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(test_sh, "tests/switch_transfer_docs_test.lua", "scripts/test.sh")
mustContain(test_sh, "T0 switch transfer docs gate", "scripts/test.sh")
mustContain(build_doc, "tests/switch_ci_workflows_test.lua", "switch-build.md path list")
mustContain(build_doc, "tests/switch_transfer_docs_test.lua", "switch-build.md path list")
-- --- SWCI-08: release Switch hard-fail (no continue-on-error on build/stage) ---
do