Commit Graph
31 Commits
Author SHA1 Message Date
aiongg ced652cd37 gate: first-party actions at the gate-setup repin (runner cargo home for rust-cache) (#322) 2026-11-22 01:04:28 -05:00
aiongg ec2b41fc48 gate-setup: pin the first-party actions to the runner cargo home commit (#321) 2026-11-22 01:03:45 -05:00
aiongg 8de85f814f gate: first-party actions at the gate-setup repin (WebDAV sccache on cluster runners) (#319) 2026-11-22 00:01:09 -05:00
aiongg ab4f427845 Merge pull request #297 from aiongg/gate-shard-archives
gate: shard-archives input, one test archive per shard
2026-11-19 18:37:46 -05:00
aiongg 94acf97a73 gate: trim a saving leg's cache entry to the build's units; first-party actions at the gate-setup repin
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.
2026-11-19 23:19:14 +00:00
aiongg ab35cb2622 gate-setup: pin the first-party actions to the rust-cache unit-record commit 2026-11-19 23:19:14 +00:00
aiongg 9c45691f44 gate: shard-archives input, one test archive per shard
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.
2026-11-19 20:44:30 +00:00
aiongg 8341b41f55 gate: drop the prune-cache job; a called workflow's job permissions are checked at run start 2026-11-19 14:05:10 +00:00
aiongg ac2e87d47a gate: cache budget inputs (lint-cache, prune-cache) and a confined prune job; sonarcloud: build-cache input 2026-11-19 13:57:40 +00:00
aiongg a8fb24c80e gate: pin the shared actions to #290's merge commit 2026-11-19 13:39:04 +00:00
aiongg 528446563c gate: build the tests once per runner and keep workspace crates in a rolling cache entry
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.
2026-11-19 09:30:18 +00:00
aiongg 7513b173b4 Merge craft-common-actions#252 (canonical save-if) into the gate change
# Conflicts:
#	README.md
2026-11-19 09:25:52 +00:00
FredApps 2c06746765 ci: pin nested shared gate actions to reviewed revision (#289) 2026-11-19 13:34:26 +07:00
aiongg 6b0c83fa60 gate: cache-name and dev-strip inputs; manual Windows build diagnostic
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.
2026-11-19 02:21:58 +00:00
FredApps da827200d9 test: assert producer artifact retention 2026-11-19 01:29:28 +01:00
FredApps 204c556c5f Merge main and preserve artifact uploads on validated producers 2026-11-19 01:28:57 +01:00
aiongg 112ef59c08 gate: each shard leg records its latest status, so a re-run that fails replaces an earlier pass 2026-11-18 20:20:21 +00:00
aiongg 29d68afad0 gate: test-shards runs each runner's tests as N shard legs
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.
2026-11-18 19:09:44 +00:00
aiongg a24d4fc3de gate: cache key from native profiles only, optional cache-warm leg saves after the build
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.
2026-11-18 14:14:58 +00:00
skylar taylor-barrick 788c2744ac tests(gate): keep the save-condition tests away from the pin guards
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.
2026-11-18 03:52:27 +01:00
skylar taylor-barrick 16d88e0e6b ci(rust-cache): only an accepted save-if true permits a save
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.
2026-11-18 03:51:54 +01:00
aiongg efe146ee91 gate: key the caller cache on files too (cache-key-files)
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.
2026-11-17 18:57:53 +00:00
aiongg f8f8952237 gate: cache the data the caller's setup fetches (cache-paths, cache-key)
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).
2026-11-17 18:53:15 +00:00
aiongg 7d989465c1 gate: lint legs beside the test legs (lint-command)
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.
2026-11-17 18:52:39 +00:00
Ephraim 42e79d293e gate: optional artifact upload 2026-11-16 19:00:57 +02:00
skylar taylor-barrick 2537691a6b ci: share dependency-cache keys and read-only restores (#240)
* 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.
2026-11-14 21:01:18 -06:00
Dylan M. Taylor fd88e26a87 feat(gate): support caller setup commands (#224) 2026-11-12 21:51:38 -05:00
FredApps bb16e4122a gate.yml: optional gate-timeout-minutes stops a hung gate with a process list and a clear error (#143)
CI green; CodeRabbit rate-limited with no findings; 0 review threads.
2026-11-05 11:27:56 +01:00
FredAppsandClaude Opus 5.5 c1f5c18c01 feat(gate): packages is optional; an empty list installs none
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>
2026-11-01 04:26:35 +01:00
FredApps 2b3fb9dc05 ci: preserve dependency cache reuse across root manifest updates (#108)
* ci: preserve dependency cache reuse across root manifest updates

* docs: align gate cache overview with profile keys and dispatch opt-in
2026-10-30 07:47:08 -04:00
aiongg 9587bf235d Shared quality-gate workflow for the craft apps (gate.yml) (#69)
* 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>).
2026-10-23 12:15:49 -04:00