A leg that saves runs actions/cache-trim after its last build command (in the gate job, after the
artifact upload), before rust-cache's post step saves; it changes nothing unless the build recorded
its units in CRAFT_CACHE_UNITS, which actions/rust-cache sets only where the leg saves.
With archive-command and shard-archives: true, the build job sets NEXTEST_ARCHIVE_DIR,
NEXTEST_ARCHIVE_NAME and GATE_SHARDS, archive-command writes one archive per shard, and each is
uploaded as gate-archive-<os>-<k>. Shard k downloads only its own, so it fetches only the test
binaries it runs. One upload step per archive caps shard-archives at 8 shards; the select job
rejects more, and shard-archives without archive-command. Off by default: one archive for every
shard, as before.
With archive-command, a build (<os>) job per runner builds the tests once
into a nextest archive; the shard legs download it and build nothing, and
only they wait for the build job. after-archive-command runs in the build
job after the upload. With cache-workspace-crates, the saving leg writes a
rolling dependency entry that keeps the workspace crates, and every leg
restores the newest one with restore-mtimes. The lint legs move to a lint
job of their own that never waits for the build. Every job's setup is
actions/gate-setup; commands run through actions/gate-run. Every new input
defaults to today's behaviour.
The save-condition guards read the cache-save and writes inputs every job
passes to gate-setup: the build and lint jobs carry the approved condition,
the gate job the same narrowed to its one saving leg per runner.
Result markers are files named after their leg and download with
merge-multiple, so one shard or one build lands where the check reads it.
The archive upload overwrites on a re-run. archive-command without
test-shards is an error.
The first-party actions are pinned to the commit that added gate-setup.
cache-name gives each call of the gate in one job its own dependency-cache entry (gate-<name>); the default keeps today's key. dev-strip builds the test profile without debug info and strips symbols.
With test-shards N > 0, the gate leg of each runner becomes N test <k>/<N>
(<os>) legs. Each has the full setup, restores the gate's Rust cache entry and
runs shard-command (windows-shard-command on Windows) with GATE_SHARD,
GATE_SHARDS and NEXTEST_PARTITION (hash:<k>/<N>) set, building and running
its share of the tests. Shard 1 saves the cache by the gate leg's rules (the
warm leg saves instead when there is one); the others only restore. lint and
cache warm legs run once per runner. A gate (<os>) job passes only when every
shard of that runner passed, from per-shard pass markers.
test-shards defaults to 0, which leaves every existing call as it was.
The rust-cache key hashes the root [profile] tables except wasm-only ones (web, wasm-*), so a
web-profile edit no longer starts every native cache cold. A new warm-command input adds a
default-branch leg that runs only the build and saves the gate entry as soon as it succeeds,
instead of after the tests.
Replacing substrings inside the existing test's body and adding the reader, truth table
and contract tests as one block at the end of the module keeps this change disjoint
from a pinning change to the same file: nothing is inserted beside the pin-guard
constants or between the pin-guard tests. Coverage and selection are unchanged.
rust-cache trims its save-if input and falls back to true when nothing is left, so a
whitespace-only value arrived at the shipped action as "save= " and granted a save the
caller never asked for. Emit one canonical word instead: an accepted true (ASCII
whitespace trimmed, ASCII case ignored) saves; empty, whitespace-only and unrecognized
values restore only, in a single GITHUB_OUTPUT record so a newline in the input cannot
override the decision.
Lock the gate's cache-write condition by tokens rather than substrings, and add an
event/ref/default-branch/dispatch truth table plus a gate-to-action contract test, so
an appended "|| true" or a dropped pull-request guard fails instead of passing. The
gate expression and its behaviour are unchanged.
A caller that keeps its pins in the fetch script names it in cache-key-files, so
the pin is written once and a new pin or fetch starts a new entry. The key is
computed once and used by both the restore and the save.
The cache-extra-paths item of #212. The paths are restored before setup-command
and saved after it under the dependency cache's save rule, one entry for every
OS, keyed on the caller's pins. craft-libs uses it for the PhotoCraft PSD corpus,
which otherwise builds PhotoCraft's xtask on every leg (1:51 on Windows).
With lint-command set, each runner in os gets a lint (<os>) leg that runs the
lint checks with the same setup, so clippy no longer runs before the test build
on the critical path. One job definition with a part matrix dimension; the test
part keeps the gate (<os>) check name, and the lint part has its own rust-cache
entry. Empty lint-command keeps today's behaviour.
* ci: share the gate dependency-cache key and read-only restores
* fix(rust-cache): compare cache directories, not their spelling
A Windows runner spells one directory two ways: git-bash reports $HOME/.cargo as
/c/Users/x/.cargo, and a native tool or workflow input passes C:\Users\x\.cargo. The
align-environment guard compared the strings, so the first Windows caller copying the
README example exited 1 with "sets ...; drop the input". It now resolves both sides when
they exist and otherwise normalises backslashes, a drive letter and its case before
comparing. Refusing a genuinely different cargo home is unchanged.
Regressions cover both Windows spellings, a trailing separator, a drive letter in either
case, two different Windows homes, and a symlinked home that resolves to $HOME/.cargo;
the five positive cases fail against the previous guard.
Calls with nothing to install from apt (a Windows-only check, a wasm build) had to pass a package
list the gate would ignore or install for nothing. packages now defaults to empty, and the apt step
runs only on Linux legs that name packages. The README describes such second gate calls, with
their own command and cache-version, instead of keeping web builds in the app's own workflow:
the apps' CI rules now allow only calls to shared workflows (#118).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* ci: add a shared CI workflow for the craft apps
A reusable workflow that runs each app's quality gate (by default
`cargo xtask ci`) on one or more runners, with the suite's shared setup:
cached apt packages, the repository's toolchain, prebuilt cargo tools,
the craft-fonts and craft-i18n checkouts, and a dependency cache that only
the default branch writes.
The rust-cache key includes the root Cargo.toml: rust-cache hashes only
the workspace members' manifests, so a [profile] change in a virtual root
manifest would otherwise keep restoring the old cache.
Part of #60.
* tests: cover the shared CI workflow
test_ci.py checks that third-party actions are pinned to commits, that
only non-PR runs on the default branch save the cache, that caller input
reaches run blocks only through env, and runs the caller-environment
script under bash to check it writes valid KEY=VALUE lines and rejects
others. The craft-fonts test also holds ci.yml to the suite's pin, and the
test workflow runs on changes to ci.yml.
* docs: document the shared CI workflow
Describes what ci.yml sets up and runs, with a plain caller and one that
adds a Windows leg on main, manual runs and full-ci pull requests.
* actions: don't persist credentials in the craft-fonts and craft-i18n checkouts
Both repositories are public and nothing later in a job runs git in them,
so the token has no use there.
* ci: name the shared workflow gate.yml
The repository's own CI proposed in #21 takes .github/workflows/ci.yml.
Callers use .github/workflows/gate.yml@main; the job still reports as
gate (<os>).