ci: skip native builds on no-rust PRs; shrink matrix to linux x64 on PR#48
Conversation
The Build Native workflow ran the full 5-platform matrix (linux x64 + linux arm64 + mac x86 + mac arm + windows) on every PR push, even when the PR didn't touch the native crate. macOS runners are ~10x ubuntu cost, windows ~2x — this PR cuts that: - pull_request trigger now path-filtered to packages/cachekit-core-ts/**, pnpm-lock.yaml, and this workflow file. PRs that don't touch the crate skip the workflow entirely. - A new `matrix` job resolves the build matrix dynamically: PRs build only x86_64-unknown-linux-gnu on the self-hosted runner (catches the vast majority of compile errors cheaply). push to main and release tags still build the full 5-target matrix, which is what actually gates publication. No change to the test or publish jobs: test downloads the linux x64 artifact (always produced) and publish only fires on tags (full matrix).
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
📝 WalkthroughWalkthroughThe ChangesBuild Native Workflow Optimization
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. Comment |
Summary
build-native.ymlran the full 5-platform matrix on every PR push: linux x64 (self-hosted) + linux aarch64 (ubuntu-latest) + macOS x86 + macOS arm + Windows. macOS runners are ~10× ubuntu cost, Windows ~2×. For a typo fix to a markdown file this was firing five platform builds. Two cheap levers close most of the cost:pull_request— the workflow no longer triggers at all for PRs that don't touch the native crate. Only PRs changingpackages/cachekit-core-ts/**,pnpm-lock.yaml, or this workflow itself will spin up runners.matrixjob resolves the build matrix at run-time. On PRs it shrinks to justx86_64-unknown-linux-gnu(the self-hosted runner — already paid for, cheap, catches the vast majority of compile errors). Onpush: mainand release tag pushes the full 5-target matrix still runs — that's the gate that actually feeds publication, so coverage where it matters is preserved.Cost model after this PR
cachekit-core-ts/push: maincachekit-core-ts-v*Why this is safe
testjob depends onbuildand downloads thebindings-x86_64-unknown-linux-gnuartifact specifically — that artifact is always produced (it's in both the PR matrix and the full matrix), so the test gate is unaffected.publishjob only fires onrefs/tags/cachekit-core-ts-v*, which always pushes (not PRs), so the full matrix runs before publish. No risk of shipping platform packages that weren't built.push: mainrun — and if one slips through, it surfaces before any release tag, not in a customer'spnpm install.Test plan
actionlintclean (run locally via prek)cachekit-core-ts/**→build-native.ymlshould skip entirely on this PR. (If you see it run, the path filter regressed.)push: mainruns all 5 platformsOut of scope
chore/release-hardeningPR)runs-onstrategy forci.yml's self-hosted runners (separate, larger change)Summary by CodeRabbit