mirror of
https://github.com/bryanthaboi/gen1recomp.git
synced 2026-08-20 20:50:21 +02:00
fix(ci): update platform artifact workflow gate
This commit is contained in:
@@ -178,7 +178,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-.*\.md$|tests/switch_ci_workflows_test\.lua$|tests/switch_transfer_docs_test\.lua$|\.github/workflows/(ci|release|switch-artifact-comment)\.yml$|src/core/(NxAssetOverlay|Platform|GameVersion)\.lua$|src/import/CacheFs\.lua$|tests/engine/(assets_version_fallback|nx_generated_guard|nx_yellow_boot|switch_diagnostics|cache_fs_gold_nx_load)_test\.lua$|tests/engine/platform_nx)'; 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|platform-artifact-comment)\.yml$|src/core/(NxAssetOverlay|Platform|GameVersion)\.lua$|src/import/CacheFs\.lua$|tests/engine/(assets_version_fallback|nx_generated_guard|nx_yellow_boot|switch_diagnostics|cache_fs_gold_nx_load)_test\.lua$|tests/engine/platform_nx)'; then
|
||||||
echo "changed=true" >> "$GITHUB_OUTPUT"
|
echo "changed=true" >> "$GITHUB_OUTPUT"
|
||||||
else
|
else
|
||||||
echo "changed=false" >> "$GITHUB_OUTPUT"
|
echo "changed=false" >> "$GITHUB_OUTPUT"
|
||||||
|
|||||||
@@ -188,8 +188,8 @@ or the Switch-related workflow YAML), CI runs:
|
|||||||
head is that repo (same-repo push/PR). Fork CI never runs fused. Fork PRs into the main repo 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. Fused also waits for a successful offline selftest before starting on the Mac runner.
|
head is that repo (same-repo push/PR). Fork CI never runs fused. Fork PRs into the main repo 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. 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
|
3. On successful PR fused builds, a follow-up workflow posts a PR comment
|
||||||
linking the Actions artifact named `gen1recomp-switch-nro`
|
linking the Actions artifact named `gen1recomp-switch-nro`
|
||||||
(comment tag `switch-build-result`; see
|
(comment tag `platform-build-result`; see
|
||||||
`.github/workflows/switch-artifact-comment.yml`).
|
`.github/workflows/platform-artifact-comment.yml`).
|
||||||
|
|
||||||
Unrelated PRs do not burn the self-hosted Mac on Switch packaging.
|
Unrelated PRs do not burn the self-hosted Mac on Switch packaging.
|
||||||
|
|
||||||
|
|||||||
@@ -26,12 +26,11 @@ end
|
|||||||
-- Also gates the NX runtime modules and the NX engine suites so an NX
|
-- Also gates the NX runtime modules and the NX engine suites so an NX
|
||||||
-- runtime regression cannot slip past switch-selftest / switch-build.
|
-- runtime regression cannot slip past switch-selftest / switch-build.
|
||||||
local SWITCH_PATH_REGEX =
|
local SWITCH_PATH_REGEX =
|
||||||
[[^(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$|src/core/(NxAssetOverlay|Platform|GameVersion)\.lua$|src/import/CacheFs\.lua$|tests/engine/(assets_version_fallback|nx_generated_guard|nx_yellow_boot|switch_diagnostics|cache_fs_gold_nx_load)_test\.lua$|tests/engine/platform_nx)]]
|
[[^(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|platform-artifact-comment)\.yml$|src/core/(NxAssetOverlay|Platform|GameVersion)\.lua$|src/import/CacheFs\.lua$|tests/engine/(assets_version_fallback|nx_generated_guard|nx_yellow_boot|switch_diagnostics|cache_fs_gold_nx_load)_test\.lua$|tests/engine/platform_nx)]]
|
||||||
|
|
||||||
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")
|
||||||
local comment_wf = read(".github/workflows/switch-artifact-comment.yml")
|
local comment_wf = read(".github/workflows/platform-artifact-comment.yml")
|
||||||
local ios_comment_wf = read(".github/workflows/ios-artifact-comment.yml")
|
|
||||||
|
|
||||||
-- --- SWCI-01: path detector ---
|
-- --- SWCI-01: path detector ---
|
||||||
mustContain(ci, "switch-changes:", "ci.yml")
|
mustContain(ci, "switch-changes:", "ci.yml")
|
||||||
@@ -129,28 +128,26 @@ do
|
|||||||
end
|
end
|
||||||
|
|
||||||
-- --- SWCI-06 / SWCI-07 / SWFIX-01: PR artifact comment (no delete-all clobber) ---
|
-- --- SWCI-06 / SWCI-07 / SWFIX-01: PR artifact comment (no delete-all clobber) ---
|
||||||
mustContain(comment_wf, "workflows: [ci]", "switch-artifact-comment")
|
mustContain(comment_wf, "workflows: [ci]", "platform-artifact-comment")
|
||||||
mustContain(comment_wf, "gen1recomp-switch-nro", "switch-artifact-comment")
|
for _, artifact in ipairs({
|
||||||
mustContain(comment_wf, "comment-tag: switch-build-result", "switch-artifact-comment")
|
"gen1recomp++-macos",
|
||||||
mustContain(comment_wf, "pull_request", "switch-artifact-comment")
|
"gen1recomp++-ios-ipa",
|
||||||
mustContain(comment_wf, "conclusion == 'success'", "switch-artifact-comment")
|
"gen1recomp-switch-nro",
|
||||||
mustContain(comment_wf, 'exit 0', "switch-artifact-comment no-op")
|
"gen1recomp-xbox-uwp",
|
||||||
mustContain(comment_wf, "**Commit**:", "switch-artifact-comment")
|
"gen1recomp-linux-arm64",
|
||||||
mustContain(comment_wf, "**Build Time**:", "switch-artifact-comment")
|
}) do
|
||||||
mustContain(comment_wf, "View workflow run", "switch-artifact-comment")
|
mustContain(comment_wf, artifact, "platform-artifact-comment")
|
||||||
mustContain(comment_wf, "thollander/actions-comment-pull-request@v3", "switch-artifact-comment")
|
end
|
||||||
mustNotContain(comment_wf, "delete-comment", "switch-artifact-comment")
|
mustContain(comment_wf, "comment-tag: platform-build-result", "platform-artifact-comment")
|
||||||
mustNotContain(comment_wf, "izhangzhihao/delete-comment", "switch-artifact-comment")
|
mustContain(comment_wf, "pull_request", "platform-artifact-comment")
|
||||||
|
mustContain(comment_wf, "conclusion == 'success'", "platform-artifact-comment")
|
||||||
mustContain(ios_comment_wf, "comment-tag: ios-build-result", "ios-artifact-comment")
|
mustContain(comment_wf, 'exit 0', "platform-artifact-comment no-op")
|
||||||
mustContain(ios_comment_wf, "thollander/actions-comment-pull-request@v3", "ios-artifact-comment")
|
mustContain(comment_wf, "**Commit**:", "platform-artifact-comment")
|
||||||
mustNotContain(ios_comment_wf, "delete-comment", "ios-artifact-comment")
|
mustContain(comment_wf, "**Build Time**:", "platform-artifact-comment")
|
||||||
mustNotContain(ios_comment_wf, "izhangzhihao/delete-comment", "ios-artifact-comment")
|
mustContain(comment_wf, "View workflow run", "platform-artifact-comment")
|
||||||
-- Distinct tags so both commenters can coexist on the same PR
|
mustContain(comment_wf, "thollander/actions-comment-pull-request@v3", "platform-artifact-comment")
|
||||||
check(comment_wf:find("comment-tag: switch-build-result", 1, true)
|
mustNotContain(comment_wf, "delete-comment", "platform-artifact-comment")
|
||||||
and ios_comment_wf:find("comment-tag: ios-build-result", 1, true)
|
mustNotContain(comment_wf, "izhangzhihao/delete-comment", "platform-artifact-comment")
|
||||||
and comment_wf:find("comment-tag: ios-build-result", 1, true) == nil,
|
|
||||||
"iOS and Switch comment-tags must be distinct and present")
|
|
||||||
|
|
||||||
-- --- SWCI-08 / SWCI-09: docs CI vs release ---
|
-- --- SWCI-08 / SWCI-09: docs CI vs release ---
|
||||||
local build_doc = read("docs/switch-build.md")
|
local build_doc = read("docs/switch-build.md")
|
||||||
@@ -161,7 +158,7 @@ mustContain(build_doc, "ubuntu-latest", "switch-build.md")
|
|||||||
mustContain(build_doc, "selftest_build_switch.sh", "switch-build.md")
|
mustContain(build_doc, "selftest_build_switch.sh", "switch-build.md")
|
||||||
mustContain(build_doc, "main repo", "switch-build.md")
|
mustContain(build_doc, "main repo", "switch-build.md")
|
||||||
mustContain(build_doc, "gen1recomp-switch-nro", "switch-build.md")
|
mustContain(build_doc, "gen1recomp-switch-nro", "switch-build.md")
|
||||||
mustContain(build_doc, "switch-build-result", "switch-build.md")
|
mustContain(build_doc, "platform-build-result", "switch-build.md")
|
||||||
mustContain(build_doc, "hard gate", "switch-build.md")
|
mustContain(build_doc, "hard gate", "switch-build.md")
|
||||||
mustContain(build_doc, "continue-on-error", "switch-build.md")
|
mustContain(build_doc, "continue-on-error", "switch-build.md")
|
||||||
mustContain(build_doc, "nacptool", "switch-build.md")
|
mustContain(build_doc, "nacptool", "switch-build.md")
|
||||||
|
|||||||
Reference in New Issue
Block a user