From d13064ee64e1c761fc41c8093cc5903c7190608c Mon Sep 17 00:00:00 2001 From: Andrew Quenehen Date: Sun, 2 Aug 2026 22:08:49 -0300 Subject: [PATCH] ci(switch): run fused build only after offline selftest Avoid burning the self-hosted Mac when the ubuntu packaging gate fails. Co-authored-by: Cursor --- .github/workflows/ci.yml | 8 +++++--- docs/switch-build.md | 3 ++- tests/switch_ci_workflows_test.lua | 3 +++ 3 files changed, 10 insertions(+), 4 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index db68abee..6f3b64e7 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -144,9 +144,11 @@ jobs: switch-build: name: Switch fused build - needs: switch-changes - if: >- - needs.switch-changes.outputs.changed == 'true' + needs: [switch-changes, switch-selftest] + if: | + always() + && needs.switch-changes.outputs.changed == 'true' + && needs.switch-selftest.result == 'success' && github.repository == 'bryanthaboi/gen1recomp' && (github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name == github.repository) diff --git a/docs/switch-build.md b/docs/switch-build.md index 33a4b330..379424cc 100644 --- a/docs/switch-build.md +++ b/docs/switch-build.md @@ -146,7 +146,8 @@ runs: head is that repo (same-repo push/PR). **Fork repository** CI never runs fused. **Fork → canonical PRs** also skip Switch fused (offline selftest still runs) so untrusted head code is not executed on the self-hosted Mac; - iOS device build eligibility is unchanged. + iOS device build eligibility is unchanged. Fused also waits for a successful + offline selftest before starting on the Mac runner. 3. On successful PR fused builds, a follow-up workflow posts a PR comment linking the Actions artifact named `gen1recomp-switch-nro` (comment tag `switch-build-result`; see diff --git a/tests/switch_ci_workflows_test.lua b/tests/switch_ci_workflows_test.lua index 9d200397..4e274e29 100644 --- a/tests/switch_ci_workflows_test.lua +++ b/tests/switch_ci_workflows_test.lua @@ -74,6 +74,9 @@ do local rest = ci:sub(start) local nextJob = rest:find("\n [%w_-]+:", 2) local block = nextJob and rest:sub(1, nextJob - 1) or rest + mustContain(block, "needs: [switch-changes, switch-selftest]", "switch-build needs") + mustContain(block, "needs.switch-selftest.result == 'success'", "switch-build waits for selftest") + mustContain(block, "always()", "switch-build always() for skipped deps") mustContain(block, "needs.switch-changes.outputs.changed == 'true'", "switch-build") mustContain(block, "bryanthaboi/gen1recomp", "switch-build canonical") mustContain(block, '["self-hosted", "macOS"]', "switch-build runner")