rust-cache caches and, at save, prunes the registry, git and bin directories
under CARGO_HOME, with no input to leave them out. The cluster runners'
CARGO_HOME is a crate cache shared across jobs, and align-environment refused
it outright. When CARGO_HOME is the directory the runner names in
CRAFT_RUNNER_CARGO_HOME, rust-cache gets a job-private directory as its
CARGO_HOME, with or without align-environment; a CARGO_HOME the job sets
itself is still refused. GitHub-hosted runs take the same steps as before.
* fix(gate-setup): use WebDAV sccache when SCCACHE_WEBDAV_ENDPOINT is set
* gate-setup: one WebDAV sccache prefix for every repository (sccache/<cache-version>), so dependency compiles hit across apps
---------
Co-authored-by: aiongg <aiongtaigi@gmail.com>
With select-tests, the action also outputs the tests to run: those of the
crates that own a changed file, of the crates that declare a read of it
([package.metadata.craft] reads), and of every crate that depends on
them by any dependency kind, as a nextest filterset (filter), a member
list (skip) and all/some/none (tests). The build setup, a crate's own
Cargo.toml and non-documentation files outside the crates run every
test; documentation alone runs none. The same pass fails on an
undeclared or stale cross-crate read. The docs input adds documentation
globs for both selections.
The check accepts the old house-rules blocks or one craft-agents block
(standards/app-agents.md, RFC-0072). write-agents writes or refreshes the
block from a craft-contrib commit on main and keeps text outside it.
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.
- rust-cache: a saving leg's crates entry is <job>-crates-<os>-<arch>-<parent run>-0, from
.ci-cache-meta/entry, so of two runs that restored the same entry only the first to finish
saves (GitHub refuses an existing key). Nothing restored gives -0-0; a cold build writes
-<run>-<attempt>. A saving leg gets CRAFT_CACHE_UNITS, a file for the build's Cargo JSON
messages; the name is outside the prefixes rust-cache hashes into its key.
- cache-trim: deletes every unit directory (<profile>/build/<package>/<hash>/) the record does
not name, before rust-cache's post step saves; rust-cache's own cleanup matches package names
only and keeps older builds of updated dependencies. No record, no change.
- cache-prune: for a caller job with actions: write. Keeps the newest rolling crates entry per
job/OS/arch, and of other rust-cache entries and named <name>-<sha256> entries removes an older
one once nothing used it since the newest was created. watch: prunes as the run's saving jobs
finish and ends when none is queued or running.
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.
The setup the gate's jobs repeat after their checkout, as one composite
action, so a build job and its shard legs can share it. Its first-party
actions are pinned to the commit that added rust-cache's
cache-workspace-crates and restore-mtimes. gate.yml does not call it yet.
actions/rust-cache gains cache-workspace-crates and restore. With
cache-workspace-crates the entry also keeps the workspace crates' compiled
libraries and unit-test executables, as a rolling entry: a saving run writes
an entry of its own and every run restores the newest under the job's prefix,
since rust-cache never replaces an existing key. Both inputs default to
today's behaviour.
actions/restore-mtimes records the commit an entry was built from (and the
commits of the craft-i18n and craft-fonts checkouts), and after a restore
touches only the files that changed since then, so Cargo rebuilds only what
they reach.
actions/gate-run runs one of gate.yml's commands with its optional timeout.
gate.yml is unchanged; it moves to these actions in a separate change.