Skip to content

Migrate CI off stacks-sbtc/actions to upstream actions, pinned by SHA - #231

Merged
xoloki merged 1 commit into
mainfrom
migrate-ci-actions
Nov 18, 2026
Merged

xoloki merged 1 commit into
mainfrom
migrate-ci-actions

Conversation

@xoloki

@xoloki xoloki commented Nov 18, 2026

Copy link
Copy Markdown
Owner

Why

Every uses: step in all three workflows routed through stacks-sbtc/actions composite wrappers — the last piece of the old org's infrastructure still in the loop after the repo transfer. They are thin shims (setup-rust-toolchain just wraps actions-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 the setup-rust-toolchain shim exposes no toolchain input 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:

Replaces With Pin
stacks-sbtc/actions/checkout actions/checkout 3d3c42e5 (v7.0.1)
stacks-sbtc/actions/setup-rust-toolchain actions-rust-lang/setup-rust-toolchain a188e68d (v2.0.1)
stacks-sbtc/actions/upload-artifact actions/upload-artifact cf430e03 (v7.0.2)
.../github-pages/configure-pages actions/configure-pages 45bfe019 (v6.0.0)
.../github-pages/upload-pages-artifact actions/upload-pages-artifact fc324d35 (v5.0.0)
.../github-pages/deploy-pages actions/deploy-pages 368f8252 (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.yml upload-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-toolchain step now sets both inputs explicitly instead of inheriting defaults:

rustflags: "-D warnings"
build-warnings: ""

Read from the two action manifests at the exact pinned SHAs:

  • v1.15.2 defaults rustflags to "-D warnings" — so today every job runs with RUSTFLAGS=-D warnings.
  • v2.0.1 defaults rustflags to "" and instead defaults build-warnings to "deny", exporting CARGO_BUILD_WARNINGS=deny (action.yml lines 146-150, each applied only when the variable is not already set).

These are not equivalent. RUSTFLAGS reaches dependencies compiled from source; CARGO_BUILD_WARNINGS applies 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 package job running cargo publish --dry-run. It exercises the same packaging and verify-build that a real release performs, but needs no crates.io environment and no token, so it can gate every PR instead of first running during an actual release. This matters because publish.yml has 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_dispatch on publish.yml, with a dry_run boolean defaulting to true, and the real cargo publish step gated on github.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: write from the doc job in ci.yml. That job uploads artifacts and has never deployed, so the permission was an over-grant.

Deliberately not in here

No --locked yet. Cargo.lock is still gitignored, so on a fresh CI checkout there is no lockfile and --locked would 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 check on 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.toml already declares clippy and rustfmt, 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.1 vendors Swatinem/rust-cache@d1527c8f internally. If Settings → Actions → Allowed actions is restricted on this repo, both actions-rust-lang/* and Swatinem/* 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 to stacks-sbtc remains 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 — clean
  • cargo clippy --all-targets --all-features -- -D warnings -A clippy::op-ref -A clippy::needless-range-loop — 0 diagnostics
  • cargo test — 88 passed
  • cargo test --features with_v1 — 164 passed
  • cargo publish --dry-run — packages and verify-builds clean

The real proof is this PR's own CI run: it is the first execution of every one of these actions.

🤖 Generated with Claude Code

@xoloki xoloki self-assigned this Nov 18, 2026
@xoloki
xoloki merged commit 020c26c into main Nov 18, 2026
6 checks passed
@xoloki
xoloki deleted the migrate-ci-actions branch November 18, 2026 03:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant