Commit Graph
219 Commits
Author SHA1 Message Date
Dylan M. Taylorandaiongg e084cb8552 ci: use artcraft-k8s-trusted runner on main (#16368)
* ci: use artcraft-k8s-trusted runner on main

* ci: sccache on main runs, which use the shared cluster cache on the trusted runners

---------

Co-authored-by: aiongg <[email protected]>
2026-11-22 00:03:23 -05:00
FredAppsandFredApps c0771fe72b Build the CI archive driver without framework-only lint dependencies (#15963)
* Use the document mutator in the damage-history fixture

* Compile the archive driver without framework-only lint dependencies

---------

Co-authored-by: FredApps <[email protected]>
2026-11-21 00:07:08 +07:00
aiongg 4d91c2ec04 Merge pull request #15826 from aiongg/ci-shard-archives
CI: one test archive per shard, balanced by recorded test times
2026-11-19 20:03:50 -05:00
aiongg 7a2dbc9b6f Merge pull request #15828 from aiongg/ci-cache-budget
CI: keep the Actions cache within its budget (trim saved entries, prune replaced ones as they land)
2026-11-19 19:50:16 -05:00
aiongg 0b09cee9f9 ci: prune each replaced cache entry as soon as its successor is saved
cache-prune replaces gate-cache-prune. It starts with the run (the gate is one reusable call, so
needs: gate waited for every shard) and runs craft-common-actions' cache-prune action in watch
mode: each time the gate's build jobs, web or corpus finish, it deletes the entries their new
entries replace (the older rolling crates entry, and lockfile- or manifest-keyed entries nothing
used since), and it ends when none of those jobs is queued or running.
2026-11-19 22:20:51 +00:00
aiongg aac8e37bec CI: one test archive per shard, balanced by recorded test times
The gate's build job writes one nextest archive per shard (craft-common-actions gate.yml
shard-archives), so each shard downloads only the test binaries it runs instead of the whole
2.4-2.6 GB archive.

`cargo xtask ci archive` builds and lists the tests once, then plans the shards
(xtask/src/shards.rs): whole binaries go to the lightest shard, heaviest first, by the times in
.config/ci-test-times.tsv; a binary heavier than half a shard's share is split by test filter along
its module tree, and its executable goes into each archive that runs part of it. On Linux shard 1
takes every binary with gpu-group tests. The build checks that every test runs on exactly one shard,
writes the plan into the target directory, which every archive carries, and archives each shard
with `cargo nextest archive -E`. A shard runs `xtask ci tests --shard <k>` with its part of the
plan; the slice partition is gone.

scripts/ci-test-times.py refreshes the times file from a CI run's shard logs; a missing or stale
row only costs balance.
2026-11-19 20:47:26 +00:00
aiongg 8ca6d3c767 web CI: skip wasm-opt --converge on pull requests 2026-11-19 20:19:35 +00:00
aiongg aeeebb8e78 ci: shared workflows and actions from storytold/craft-common-actions main 2026-11-19 14:19:10 +00:00
aiongg 57847bd8bd ci: restore gate-cache-prune as a job of this workflow; lint legs keep no cache 2026-11-19 14:05:14 +00:00
aiongg 0057b98577 ci: cache budget: no lint or coverage-build caches, the rolling entry pruned right after the build 2026-11-19 13:58:15 +00:00
aiongg 8ff1a1862e ci: the cache prune lists main's entries only 2026-11-19 09:30:58 +00:00
aiongg c9746558d7 ci: build the tests once per OS, keep compiled workspace crates, balance the shards
- Both gate calls build the tests once into a nextest archive (cargo xtask ci archive); the
  shards run it, and the build job runs the doctests after the upload.
- The Linux gate keeps the compiled workspace crates in a rolling cache entry
  (cache-workspace-crates). A nightly cold build is its safety net; gate-cache-prune keeps the
  newest entry. test (without heif) restores that entry.
- The shards split the tests with nextest's slice partition, which spreads the slow modules:
  on one main run's times the non-GPU shards go from 728/493/523 s (hash) to about 602/506/625 s.

Fixes #15702
2026-11-19 08:06:05 +00:00
aiongg ec40c48cc2 ci: build the tests once per OS and run the shards from a nextest archive 2026-11-19 06:34:17 +00:00
aiongg 0052ec5ce9 ci: strip test binaries and build the craft framework at opt-level 0 in test builds 2026-11-19 02:20:03 +00:00
aiongg 2a83631d46 CI: the GPU shard runs the whole gpu group, perf jobs share one cache entry, CI-only changes run Windows 2026-11-18 20:19:02 +00:00
aiongg eee31b0d11 CI: shards build their own tests instead of running from an archive
The gate's archive of ~98 test binaries would be 10-18 GB compressed, so
every shard restores the dependency cache, builds the tests and runs its
partition (scripts/ci-test-shard.sh). `cargo xtask ci tests` runs the test
steps on $NEXTEST_PARTITION, `ci build` builds exactly what a shard builds
(main's cache warm-up), and `ci doctest` runs in one shard. The `ci archive`
part, the archive's xtask binary and the extraction are gone.

The Linux GPU shard keeps the gpu group alone on lavapipe; shards 2-4 split
the rest. Windows uses six shards: ~55 min of tests on one runner, and its
slowest test alone takes ~9.6 min, so a seventh would not shorten the
slowest shard.
2026-11-18 19:09:59 +00:00
aiongg 0e3523cdcd CI: shard the Linux and Windows tests, lint leg, xtask environment fix, rust-cache v2.9.3
- xtask starts every cargo without the variables `cargo run` sets for xtask
  (CARGO_MANIFEST_DIR, CARGO_PKG_*, ...), so a build script that declares
  `rerun-if-env-changed` for them (ring) no longer reruns, with the whole
  craft facade above it, between builds inside and outside xtask.
- `cargo xtask ci` splits into the gate's parts without a second step list:
  `lint` (fmt, egui-fork, clippy, layers, panel-commands, scorecard, wasm,
  i18n report), `archive` (test build into the nextest archive, doctests),
  `tests --from <dir>` (test and panic_hunt from the extracted archive, on
  $NEXTEST_PARTITION; --gpu / --no-gpu select by the gpu test group) and
  `build` (cache warm-up). Plain `cargo xtask ci` still runs every step.
  PHOTOCRAFT_CI_EXCLUDE leaves packages out of the test build and doctests.
- The `ci` nextest profile's archive carries the xtask binary, so a shard
  builds nothing (scripts/ci-test-shard.sh).
- Linux gate: lint leg, one build, four shards. Shard 1 runs the gpu group
  alone on lavapipe and checks its output (scripts/ci-gpu-lavapipe.py now
  wraps that run); the second GPU run and its rebuild are gone.
- Windows unit, integration, clippy and warm legs move onto the shared gate
  (Windows runner, lint leg for Clippy, four shards), keeping the PR
  selection from the platforms job, rust-lld, /OPT:NOICF, /DEBUG:NONE and
  the D:\t target dir.
- The slowest-tests-first priorities apply on Linux too.
- Swatinem/rust-cache v2.9.3 by commit for this repository's own cache
  steps, with fresh keys; cache-version v2 for the gate and docs entries.
  `test (without heif)` restores the gate's entry through the shared action.
  Dispatch-only jobs no longer save caches no pull request reads; the quick
  perf suite restores perf-nightly's entry.
- windows_delay_loads reads the app from NEXTEST_BIN_EXE_photocraft, as the
  other app tests do, since archives relocate binaries.
2026-11-18 19:04:43 +00:00
aiongg 735546b11e CI: Windows rust-cache saves again (use v2.9.1) 2026-11-18 17:00:11 +00:00
aiongg 4d5d0ecc97 ci(freebsd): run nightly and on demand only
FreeBSD no longer runs on pull requests or release pushes, so it never blocks a merge or a release.
2026-11-18 15:00:51 +00:00
aiongg 973f310aaa ci(windows): on pull requests skip the tests of platform-neutral packages the change does not reach 2026-11-18 14:56:22 +00:00
aiongg 45e01a84c7 ci: save the dependency caches from build-only warm legs on main 2026-11-18 14:55:44 +00:00
aiongg 5ccb62f44e ci(windows): skip the wasm apps' native tests 2026-11-18 14:52:57 +00:00
aiongg fea993e30c ci(windows): drop the dependency layering check, which the Linux gate runs 2026-11-18 14:52:50 +00:00
aiongg f49a6684f8 ci(windows): run Clippy in its own parallel leg 2026-11-18 14:52:46 +00:00
aiongg 33e41a6539 ci(windows): upload cargo build timings from the test legs 2026-11-18 14:52:38 +00:00
aiongg 39e85bffcb ci(windows): link the test binaries with rust-lld, without ICF or PDBs 2026-11-18 14:52:31 +00:00
aiongg 8bc1e51260 Merge storytold main into main-gate-fixes 2026-11-18 11:06:37 +00:00
FredApps 7c5d0bc6ea Merge pull request #9750 from 1Git2Clone/ci/ast-grep-cli
ci(cli): check the command-line code with ast-grep rules (RFC-0012)
2026-11-18 16:28:06 +07:00
FredApps afff03ebc7 Merge pull request #9860 from dotCooCoo/fix/manual-fuzz-nightly
Select nightly explicitly for the manual fuzz job
2026-11-18 16:21:14 +07:00
aiongg d6d93ace07 CI: craft-fonts cc9269cd8, which has Noto Sans Tamil for the Tamil language name 2026-11-17 21:04:35 +00:00
David Mann 4fe336a8c5 Merge pull request #15248 from davidmann4/ci/windows-gpu-tests-when-related
ci: run the Windows GPU tests only when their inputs change (#15247)
2026-11-17 16:48:42 +01:00
David Mann 2b170887fa Merge pull request #15234 from davidmann4/ci/windows-rust-cache-target
ci: let the Windows rust-cache find the short target directory (#15232)
2026-11-17 16:48:17 +01:00
FredApps 01b79958a7 ci(freebsd): build every target with the test profile so ui-egui's tests fit the VM (#15360)
* ci(freebsd): build with two cargo jobs so the aarch64 cross build fits the VM

The nightly aarch64 leg (a cold cross build of every target in the shared workflow's 12 GB
FreeBSD guest, CARGO_BUILD_JOBS=4) was killed with exit 137 twenty minutes into ui-egui's
targets, while photocraft-web compiled alongside them (run 43936108201). The same cold build
passed on 15 Nov, so it is at the edge of the guest's memory.

Pass `--jobs 2` through the existing cargo-build-extra-args input. It applies to the build step
of both legs; the x86_64 test commands keep the shared four jobs.

* ci(freebsd): build with the test profile, not two jobs

Two jobs didn't fix it: the x86_64 leg of the dispatched run was SIGKILLed the same way at
--jobs 2 (run 43963415772). The killed rustc was ui-egui's lib test target at -C opt-level=1:
`cargo build --all-targets` builds test targets with the dev profile, so Cargo.toml's
`[profile.test.package.photocraft-ui-egui] opt-level = 0` never applied to the build step. That
one optimised rustc over about 390k lines and 7700 tests ran the 12 GB guest out of memory, and
`cargo test` then rebuilt the same target at opt-level 0 (1m47s on x86_64) anyway.

Pass `--profile test` instead, so the build compiles every target as the tests do: ui-egui at
opt-level 0, debuginfo still off through CARGO_PROFILE_DEV_DEBUG=0 (test inherits dev), and the
test commands reuse the build's artifacts.

* ci(freebsd): test ui-egui with the build's package selection

`cargo test -p photocraft-ui-egui` resolves dependency features without the
other workspace members, so egui, epaint and everything above them got new
hashes. The test step then rebuilt ui-egui's lib tests instead of reusing
the build step's, and that rustc was SIGKILLed in the 12 GB guest.

Run ui-egui's lib, doc and integration tests through
`--workspace --features heif --exclude photocraft-gpu`, which resolves the
same units as the build (checked with cargo's unit graph: 0 units missing
from the build, against 146 for `-p photocraft-ui-egui --lib`). The
integration tests share one command, so all of them run one at a time.
2026-11-17 05:28:19 +01:00
David MannandClaude Opus 5.5 0ad38ecc19 Address CodeRabbit review: any package manifest runs the Windows GPU tests
A feature enabled in another member's Cargo.toml unifies into the workspace build the GPU tests
run in, and Cargo.lock does not record features, so a manifest-only change outside the GPU inputs
now selects the tests too.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-16 00:53:09 +01:00
David Mann 322d0309ae ci: count both sides of a move in the Windows GPU test selection (#15247)
git diff names only a rename's destination, so moving a file out of
photocraft-gpu looked like a change in the package it moved to. Also
group the platforms job's output lines (actionlint SC2129).
2026-11-16 00:06:01 +01:00
David Mann 18ca46a3d6 ci: stop when the Windows cache target path cannot be computed (#15232)
An empty path made rust-cache treat the checkout as its target
directory.
2026-11-16 00:05:21 +01:00
David Mann d971810daa ci: run the Windows GPU tests only when their inputs change (#15247)
The Windows runners render the GPU tests on WARP, Direct3D 12's CPU
rasterizer, where photocraft-gpu's tests took half of the integration
leg's test time. Pull requests now skip them on Windows unless they
change photocraft-gpu, a workspace crate it depends on (from cargo
metadata), or a non-documentation file outside the workspace packages.
main, manual runs and full-ci PRs still run them on Windows, and the
Linux gate runs them on every pull request.
2026-11-15 23:32:31 +01:00
David Mann c55c24aa47 ci: save the Windows dependency cache only from green runs (#15232)
A Clippy failure on main saved an entry without the test build's
dependencies, and rust-cache never replaces an entry with the same key.
2026-11-15 23:22:08 +01:00
David Mann 050a1f21e9 ci: let the Windows rust-cache find the short target directory (#15232)
CARGO_TARGET_DIR moved to D:\t, but rust-cache still looked for
<workspace>/target, so the Windows legs restored and saved nothing and
built every dependency on every run. Pass the target directory to
rust-cache as a path relative to the checkout, computed from
GITHUB_WORKSPACE and CARGO_TARGET_DIR.
2026-11-15 21:55:05 +01:00
dotCooCoo a9c86a5e1d Merge main into fix/manual-fuzz-nightly 2026-11-13 20:51:41 -08:00
Dylan M. Taylor b0e0bcc6c4 Merge pull request #14236 from storytold/codex/photocraft-format-migration
Move remaining file formats and codecs to craft-libs (#778)
2026-11-13 23:03:16 -05:00
dotCooCoo 058a9f1fd0 Merge main into fix/manual-fuzz-nightly 2026-11-13 06:35:23 -08:00
FredApps 3665dbd5dc CI: use the shared git-sources check, Trunk install and gate for docs (#13376)
ci.yml's platforms job ran its own copy of the git-sources check; it is
now a git-sources job calling craft-common-actions git-sources.yml.
The web job downloads Trunk through the shared install-trunk action,
which checks the archive's SHA-256, instead of an unchecked curl.
docs.yml builds the book through the shared gate with a prebuilt mdBook
0.4.52, replacing a local job with an unpinned actions/checkout@v7.
2026-11-13 15:16:35 +01:00
dotCooCoo 412251bdbc Merge main into fix/manual-fuzz-nightly 2026-11-12 15:01:00 -08:00
dotCooCoo da8a3f0601 CI: print the nightly compiler version in the manual fuzz job 2026-11-12 14:16:45 -08:00
skylar taylor-barrick cbcd62c8d1 ci: let Cargo handle oversized Windows rustc commands 2026-11-12 21:09:18 +01:00
dotCooCoo a84b260efb Merge main into fix/manual-fuzz-nightly 2026-11-11 14:50:46 -08:00
FredApps f1b5e7d727 CI: nightly release dry run (#13374)
release.yml also runs nightly on main with craft-common-actions' dry-run: every release build
except macOS, with nothing signed, pushed or drafted. Breakage that only the release build hits
(riscv64, Flatpak, FreeBSD, packaging) then shows up the next morning instead of on release
day, as it did on 11 Nov 2026.
2026-11-11 23:04:35 +01:00
Dylan M. Taylor 23c2b85a4f ci: use StepSecurity's maintained actions (#13337)
Each third-party action that StepSecurity publishes a secure drop-in
replacement for now uses that replacement, pinned to a commit with its
version as a comment. Versions follow what we used: the newest
StepSecurity release in the same major, or the closest major they
publish. dtolnay/rust-toolchain refs that named a toolchain (stable,
nightly, 1.76) become the replacement's `toolchain` input.
2026-11-11 16:02:46 -05:00
Dylan M. Taylor e119384a83 ci: run Harden-Runner on every job (#13255)
Adds step-security/harden-runner (audit, pinned to v2.22.4 like
craft-common-actions) as the first step of each job that did not have it,
so every workflow in the org's public repos reports its egress to
StepSecurity. Audit, not block: block-mode allow lists come from each
job's observed traffic.
2026-11-11 12:12:50 -05:00