Repository navigation
Migrate CI off stacks-sbtc/actions to upstream actions, pinned by SHA - #231
Merged
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why
Every
uses:step in all three workflows routed throughstacks-sbtc/actionscomposite wrappers — the last piece of the old org's infrastructure still in the loop after the repo transfer. They are thin shims (setup-rust-toolchainjust wrapsactions-rust-lang/setup-rust-toolchain@1780873c, v1.15.2), still public and still maintained, so nothing was broken. But they are a trust hop through an org this project has left, and thesetup-rust-toolchainshim exposes notoolchaininput at all, which is what made the toolchain unpinnable before #230.What
All 18 old references replaced with their upstream equivalents, every one pinned by commit SHA with the version in a trailing comment:
stacks-sbtc/actions/checkoutactions/checkout3d3c42e5(v7.0.1)stacks-sbtc/actions/setup-rust-toolchainactions-rust-lang/setup-rust-toolchaina188e68d(v2.0.1)stacks-sbtc/actions/upload-artifactactions/upload-artifactcf430e03(v7.0.2).../github-pages/configure-pagesactions/configure-pages45bfe019(v6.0.0).../github-pages/upload-pages-artifactactions/upload-pages-artifactfc324d35(v5.0.0).../github-pages/deploy-pagesactions/deploy-pages368f8252(v5.0.1)Each SHA was checked against the upstream repo: all six resolve, and all six are the exact commit their version tag points at. Note the old
static.ymlupload-pages-artifact step carried a different pin (ed353a33) from the other seventeen, so this was not a single find-and-replace.The part worth reviewing closely
The v1 → v2 jump silently changes what CI denies, so every
setup-rust-toolchainstep now sets both inputs explicitly instead of inheriting defaults:Read from the two action manifests at the exact pinned SHAs:
rustflagsto"-D warnings"— so today every job runs withRUSTFLAGS=-D warnings.rustflagsto""and instead defaultsbuild-warningsto"deny", exportingCARGO_BUILD_WARNINGS=deny(action.yml lines 146-150, each applied only when the variable is not already set).These are not equivalent.
RUSTFLAGSreaches dependencies compiled from source;CARGO_BUILD_WARNINGSapplies only to primary packages, and it requires Cargo >= 1.91 to be honoured at all. Had the defaults simply been inherited, the warning gate would have quietly changed shape — and would disappear entirely on any toolchain older than 1.91. Setting both explicitly keeps the gate byte-identical to what it is today, independent of action version and Cargo version.Also in here
A new
packagejob runningcargo publish --dry-run. It exercises the same packaging and verify-build that a real release performs, but needs nocrates.ioenvironment and no token, so it can gate every PR instead of first running during an actual release. This matters becausepublish.ymlhas never executed — 0 runs — so without it the first release would be both the workflow's debut and a real upload at once. Verified locally: Packaged 41 files, 702.7KiB.workflow_dispatchonpublish.yml, with adry_runboolean defaulting to true, and the realcargo publishstep gated ongithub.event_name == 'push' || !inputs.dry_run. A dispatch left at the default exercises checkout, toolchain install, the environment approval gate and secret injection with the upload disabled. The dry-run step also now runs unconditionally ahead of the real publish, so a packaging failure stops the job before anything is uploaded.Dropped
pages: writefrom thedocjob inci.yml. That job uploads artifacts and has never deployed, so the permission was an over-grant.Deliberately not in here
No
--lockedyet.Cargo.lockis still gitignored, so on a fresh CI checkout there is no lockfile and--lockedwould fail outright. It arrives in the next PR, together with committing the lockfile.No MSRV job yet. Planned for this PR, but it belongs with the lockfile: without
--locked,cargo checkon an old toolchain resolves the newest compatible dependencies, and Cargo before 1.84 has no MSRV-aware resolver — so the job would fail on a dependency needing a newer rustc rather than on anything about this crate. It is only meaningful once resolution is pinned, so it moves to the lockfile PR.Kept the per-job
components:inputs.rust-toolchain.tomlalready declaresclippyandrustfmt, making these redundant, but leaving them keeps this diff to the actions migration alone and avoids a red build over something cosmetic. Worth removing separately.One thing to check in settings
setup-rust-toolchain@v2.0.1vendorsSwatinem/rust-cache@d1527c8finternally. If Settings → Actions → Allowed actions is restricted on this repo, bothactions-rust-lang/*andSwatinem/*need allowlisting or these jobs will fail to start. This could not be read via API token, so it needs a look in the UI.Verification
YAML parses for all three workflows, with jobs resolving as
["check", "test-all", "fmt", "clippy", "package", "doc"],["publish"]and["deploy"]. No reference tostacks-sbtcremains anywhere under.github/. All six pinned SHAs verified against their upstream tags.Workflow changes cannot affect the build, but confirming the tree is unchanged under the pinned 1.97.1:
cargo fmt --all -- --check— cleancargo clippy --all-targets --all-features -- -D warnings -A clippy::op-ref -A clippy::needless-range-loop— 0 diagnosticscargo test— 88 passedcargo test --features with_v1— 164 passedcargo publish --dry-run— packages and verify-builds cleanThe real proof is this PR's own CI run: it is the first execution of every one of these actions.
🤖 Generated with Claude Code