Skip to content

ci: the Rust install and the wasm-bindgen steps are two composite actions (#1457) - #1491

Merged
DrunkOnJava merged 2 commits into
mainfrom
lane/1457-setup-actions
Nov 5, 2026
Merged

DrunkOnJava merged 2 commits into
mainfrom
lane/1457-setup-actions

Conversation

@DrunkOnJava

@DrunkOnJava DrunkOnJava commented Nov 5, 2026 •

Copy link
Copy Markdown
Owner

Summary

The last piece of #1457: the Rust install, which was thirty-two copies of one script, is a composite action, .github/actions/setup-rust, and the three copies of the wasm-bindgen steps are another, .github/actions/wasm-tools. Nothing else changes: the same toolchain in every job, the same rust-cache keys, the same release path.

Motivation

#1457's last box: "the Rust install is repeated 27 times and the wasm-bindgen steps 3 times". By git grep today the install is 32 steps in 10 workflows (ci.yml 17, publish.yml 5, measure.yml 2, scheduled-checks.yml 2, and one each in corpus-nightly.yml, deploy-viewer.yml, fuzz.yml, perf-budget.yml, release-binaries.yml and viewer-test.yml), each a copy of rustup toolchain install, rustup default, two echo ... >> $GITHUB_ENV lines and rustc --version, differing in the toolchain, one component, one target and whether the toolchain becomes the default.

Changes

  • .github/actions/setup-rust (new): inputs toolchain (default stable), component, target and make-default (default "true"). One shell: bash step, inputs through env: (no expression in the script), the same --profile minimal --no-self-update, then rustup default unless make-default is "false", then CARGO_INCREMENTAL=0 and CARGO_TERM_COLOR=always into $GITHUB_ENV, then rustc +<toolchain> --version. No third-party action inside it.
  • .github/actions/wasm-tools (new): the "Locked wasm-bindgen version" step, byte for byte, and taiki-e/install-action at the same SHA and the same [email protected] and locked wasm-bindgen, with the comment about the DNS outage (CI run 41954251714) moved into the action. Used by viewer-test.yml, deploy-viewer.yml and publish.yml.
  • All 32 sites use setup-rust (33 uses: the semver job takes a second for its nightly), as uses: $/.github/actions/setup-rust with only the inputs that differ from the default: component: rustfmt and clippy (fmt, clippy), toolchain: ${{ matrix.rust }} (the test matrix), toolchain: nightly-2026-10-01 (the docs.rs previews, the fuzz-check job), toolchain: ${{ env.NIGHTLY }} (Fuzz), toolchain: nightly (the floating docs.rs build), target: i686-unknown-linux-gnu, target: wasm32-unknown-unknown (three), target: ${{ matrix.target }} (release-binaries), target: ${{ runner.os == 'macOS' && matrix.target || '' }} (publish's wheels, still if: runner.os != 'Linux').
  • Three sites install a toolchain they do not make the default, with make-default: "false": the fuzz-check job (cargo +nightly-2026-10-01, its rust-cache keyed by the default stable's rustc -vV), the MCP server's 1.88 check (its own step now, cargo +1.88 check ... after the install), and the public API listing's nightly in the semver job (a second use of the action after the stable one).
  • Deploy viewer's trigger already names .github/actions/** and viewer-test.yml (ci(viewer): build the WASM once per run, and test the file Deploy viewer publishes (#1457) #1458), which covers both new actions, so it is unchanged.
  • docs/maintaining.md: a section on the two actions and on why the environment they set is not tidying.

What is the same, and what is not

Same: every job's toolchain, component and target; the default toolchain; CARGO_INCREMENTAL=0 and CARGO_TERM_COLOR=always before the cache steps; the dated nightly stays at its sites; shell: bash on the composite steps; rustup flags.

Swatinem/rust-cache hashes the default toolchain's rustc -vV and every CARGO*, CC*, CFLAGS, CXX*, CMAKE* and RUST* variable into its key (src/config.ts at the pinned SHA), so a change of default toolchain or of one of those variables in a job that restores a cache would start it from nothing. None changes:

  • every site that restores a cache set both variables and made its toolchain the default, as the action does;
  • the sites that differ are i686-overflow (no CARGO_TERM_COLOR before, which ci.yml's workflow-level env sets for every step anyway), docs-rs-nightly of scheduled-checks.yml (the same, from that file's workflow-level env; no cache there) and the Audit jobs of scheduled-checks.yml (no CARGO_INCREMENTAL before; they compile nothing, their tools are prebuilt, and restore no cache): these two files' sites gain a variable that is already set or that nothing reads;
  • the log gains rustc +<toolchain> --version where a step printed none (fuzz-check), and shows the install as one step with its inner steps.

Left alone

Nothing in the issue's list was left. publish.yml's publish-crate job runs only at a tag, so no dispatch runs its install step; it is the same invocation (setup-rust with no inputs) that release-source-smoke runs in a dispatch.

Testing

Unit tests are banned in this repository: do not add them. Show the change working end to end on real files instead.

  • tools/check-local.sh passes. N/A: CI-only change; no local compute on this lane.
  • Verified end to end on real Revit files. N/A: no Rust or reader change.
  • If this touches the IFC exporter. N/A.
  • If this is a performance change. N/A.

What was run on this head (13aa7f41):

  • python3 tools/ci/check-workflows.py: 0 errors, 0 warnings; 65 jobs run steps in 17 workflows, PENDING empty, and 67 uses of this repository's own actions and workflows, whose files exist and whose with: names only inputs they declare (the target, toolchain, component and make-default of setup-rust). actionlint exits 0.
  • zizmor 1.32.0 offline over .github on this head and on origin/main: 45 findings each (2 ignored, 37 suppressed, 6 medium, all the Dependabot 3-day cooldown), none in the new actions or the changed steps, and no inline suppression removed. The repository's own zizmor.yml runs 1.30.1 on this pull request.
  • No inline Rust install is left: git grep "rustup toolchain install\|rustup default" -- .github finds only the action's own.
  • rust-cache keys, before: the Cache Key lines of the latest CI run on main (42120229711, at 16682a7a, this branch's base): clippy v0-rust-clippy-Linux-x64-cdee7d24-2ff012fc, doc v0-rust-doc-Linux-x64-0c88e82e-2ff012fc, the shared v0-rust-ci-release-Linux-x64-cdee7d24-2ff012fc (Corpus health, MCP on Einhoven, Writer patch corpus, IfcOpenShell, bench and the Ubuntu stable build), -1bcc85bf- (MSRV), the macOS and Windows builds, v0-rust-ci-i686-Linux-x64-3f01e9d1-2ff012fc, v0-rust-ci-docs-rs-Linux-x64-ab072a77-2ff012fc, v0-rust-ci-fuzz-check-Linux-x64-cd142760-c3664f70 and the viewer's v0-rust-viewer-wasm-fast-Linux-x64-a74c6f26-2ff012fc; Deploy viewer's build on main (42112535877) v0-rust-viewer-wasm-Linux-x64-a74c6f26-2ff012fc; Measure's build on main (42121438036) v0-rust-measure-Linux-x64-a74c6f26-2ff012fc. The runs on this head are compared against them (below).

Runs on this head (13aa7f41), none read yet: not yet measured on this head until they are.

  • The draft's fast CI, run 42122477187: clippy and doc (component and default), the Ubuntu stable and MSRV builds (toolchain: ${{ matrix.rust }}), Corpus health and the MCP server on Einhoven (their rust-cache keys), the env config lint and the PII guard. At the first look fast / cargo fmt, env config lint, PII guard and both zizmor runs had passed.
  • Measure, which this pull request starts itself because it changes measure.yml (run 42122476881, Build head and Build base): the build job's install and cache. I dispatched no Measure of my own on top of it, since the filtered run asked for would build the same job again.
  • Release binaries, which a change to release-binaries.yml starts on a pull request (run 42122476923): the five targets, Windows, both macOS (one cross-compiled and smoked under Rosetta) and both Linux musl legs, with target: ${{ matrix.target }}.
  • Publish, dispatched on the branch (run 42123198927; a dispatch publishes nowhere, test-pypi stays false): the preflight, the wheel builds on all three systems (the non-Linux if: and the macOS target), the source install, the docs.rs preview on the dated nightly and the viewer smoke (target: wasm32-unknown-unknown and wasm-tools). Not run by it: publish-crate, which runs at a tag only; its install is the invocation release-source-smoke runs.
  • Deploy viewer, dispatched on the branch (run 42123203945; it deploys nothing from a branch): its build job (viewer-wasm's cache key, wasm-tools) and the two calls of viewer-test.yml.
  • The full CI on ready: every other site, and the keys compared with the list above: python3 cachekeys.py <main run> <this run> over each job's Cache Key: lines (.claude/scripts/cache-keys.py RUN_A RUN_B, kept out of the tree; the baselines are CI run 42120229711, Deploy viewer run 42112535877 and Measure run 42121438036, all on main) reports the jobs whose key differs; the expected result is none.

Audit-honesty checklist

  • README / docs reflect the current state after this PR (docs/maintaining.md)
  • A user-visible change has its entry as a fragment under changelog.d/<section>/. N/A: CI only, as agreed for CI: where the minutes go, and what to change #1457.
  • If a limitation was resolved, the "Known limitations" section is updated. N/A.
  • If a new limitation was introduced, it is documented in the PR body (none)
  • Commit messages describe WHAT changed and WHY
  • No emojis in code, docs, or commit messages
  • No private paths, personal email addresses, or internal jargon in committed files
  • Reverse-engineering finding. N/A.

Legal and contribution hygiene

  • I agree this work is licensable under Apache-2.0
  • This PR contains no Autodesk proprietary source, decompiled internals, or NDA'd SDK content
  • Any new test fixtures use synthetic values

Breaking changes

None.

Screenshots or output samples

See Testing.

Related issues

Closes #1457

…ions (#1457)

Thirty-two Rust installs, in ten workflows, were copies of one script that differed in the toolchain, one component, one target and whether the toolchain became rustup's default; they are .github/actions/setup-rust with those four inputs. The three copies of the locked wasm-bindgen version and the install of wasm-pack and that CLI are .github/actions/wasm-tools. The action sets what each copy set, because Swatinem/rust-cache hashes the default toolchain and every CARGO*/RUST* variable into its key: nothing here moves a key. The 1.88 check and the public API listing's nightly name their toolchain without making it the default (make-default false), as before. Refs #1457.
@DrunkOnJava DrunkOnJava added the ready-when-green Draft whose code is complete: marked ready for review once its fast CI passes label Nov 5, 2026
@DrunkOnJava
DrunkOnJava marked this pull request as ready for review November 5, 2026 22:39
@DrunkOnJava DrunkOnJava removed the ready-when-green Draft whose code is complete: marked ready for review once its fast CI passes label Nov 5, 2026
@DrunkOnJava
DrunkOnJava enabled auto-merge (squash) November 5, 2026 23:02
@DrunkOnJava
DrunkOnJava merged commit daf3610 into main Nov 5, 2026
56 checks passed
@DrunkOnJava
DrunkOnJava deleted the lane/1457-setup-actions branch November 5, 2026 23:46
DrunkOnJava added a commit that referenced this pull request Nov 6, 2026
…not turn a job red (#1457) (#1506)

## Summary

`rustup toolchain install` failed once on `full / build + real files /
macos-26 / stable` on #1483 at 1811752 with "could not download file
from
'https://static.rust-lang.org/dist/channel-rust-stable.toml.sha256'",
with nothing wrong in the code. rustup's own retries are over in
seconds. #1491 put the install in one composite action, so one change
now covers every job.

The install is tried three times, 20 s and 40 s apart, each failure
leaving a warning. A toolchain that really can't be installed still
fails the job, with an error, about a minute later.

The one other rustup download in CI, `rustup component add rustfmt` in
`ifcopenshell-validate`, moves into that job's setup step as `component:
rustfmt`, so it goes through the same retry.

Cache keys don't move: no toolchain and no environment variable changes,
and Swatinem/rust-cache v2.9.3 hashes neither the action file nor the
installed components. Every rust-cache key on this PR's CI run
42134631531 equals the same job's on main's run 42131995046, the
IfcOpenShell job's included
(`v0-rust-ci-release-Linux-x64-cdee7d24-2ff012fc`).

Refs #1457.

## Verification

- The action's run block, run under `bash --noprofile --norc -eo
pipefail` (as GitHub runs `shell: bash`) against a fake `rustup`,
`rustc` and `sleep`:
  - 0 failures: exit 0, 1 install, no sleep.
- 2 failures: exit 0, 3 installs, sleeps of 20 and 40, default set, 2
lines in `GITHUB_ENV`.
- 3 and 9 failures: exit 1, 3 installs, the error annotation, no default
set, nothing in `GITHUB_ENV`.
- `actionlint` exits 0.
- Not measured: a real download failure on a runner.
`tools/ci/check-workflows.py` wasn't run locally (no PyYAML here); CI
runs it.

No output, `src/` or gate file changes, so no Measure.
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.

CI: where the minutes go, and what to change

1 participant