Commit Graph
107 Commits
Author SHA1 Message Date
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 fc3e1afc1c rust-cache: leave a runner-provided cargo home (CRAFT_RUNNER_CARGO_HOME) to the runner (#320)
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.
2026-11-22 01:02:38 -05:00
aiongg 99ded52ec9 gate-setup: WebDAV sccache reads only where caches don't save, and a caller's GitHub Actions sccache settings can't override it (#318) 2026-11-21 23:47:55 -05:00
Dylan M. Taylorandaiongg 6f71b78a08 fix(gate-setup): use WebDAV sccache when SCCACHE_WEBDAV_ENDPOINT is set (#316)
* 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>
2026-11-21 23:44:22 -05:00
aiongg 0bef64f155 Merge pull request #303 from aiongg/ci-test-select
select-platforms: select the tests a pull request reaches
2026-11-20 12:16:52 -05:00
aiongg cb2451b558 select-platforms: select the tests a pull request reaches
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.
2026-11-20 04:33:41 +00:00
aiongg 2e04c2965b release, windows-arm64: install the toolchain the checkout's rust-toolchain.toml names
Part of storytold/photocraft#15711
2026-11-20 04:12:34 +00:00
aiongg 873bcb3de6 house-rules: accept the craft-agents block and add the generator
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.
2026-11-20 03:06:30 +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 bf191401c5 rust-cache: name a run's entry after the one it restored and record the build's units; cache-trim and cache-prune
- 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.
2026-11-19 23:19:14 +00:00
aiongg 102721f7a7 restore-mtimes: list the first changed files without SIGPIPE under pipefail 2026-11-19 20:27:47 +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
aiongg d82b20d6b7 actions: gate-setup, the setup every gate.yml job shares
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.
2026-11-19 09:24:12 +00:00
aiongg fabe5cc9f4 actions: rolling workspace-crates entry in rust-cache, restore-mtimes and gate-run
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.
2026-11-19 09:23:40 +00:00
FredApps fa34e3106d fix(freebsd): preserve and isolate cross-target Cargo caches 2026-11-19 03:42:06 +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 ea2e684a31 rust-cache: Swatinem v2.9.3 by commit; cache-version v2
StepSecurity's v2.9.1 cut every target/<profile>/build entry at its last '-',
so Cargo's new build-dir layout (build/<package>/<hash>/) lost most dependency
packages from each saved entry. v2.9.3 checks the exact name first (#371 there)
and keeps the Windows path fix (#355 there) that v2.9.1 was pinned for.

The cache-version default moves to v2 once: rust-cache never replaces an
exact-key entry, so the pruned v1 entries would otherwise be restored as they
are until the lockfile changes.
2026-11-18 18:54:00 +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 e89dbaf1a2 ci(rust-cache): warn about an unrecognized save-if without echoing it
The fail-closed warning printed the caller's value with printf %q. That value is
configuration and a misdirected one can be a token, which the log has no use for, so
the warning names the policy instead of the value. Normalization is unchanged; a direct
test asserts a synthetic sentinel never reaches the log.
2026-11-18 03:52:27 +01:00
skylar taylor-barrick 94729a030a ci(rust-cache): describe the ASCII-only save-if trim accurately
rust-cache's trim strips U+00A0 (NBSP) and the other Unicode spaces but leaves U+0085
(NEL) in place. The comment claimed it strips neither. Say what each one does: the
wrapper matches it on U+0085 and is deliberately narrower on U+00A0, so it is never
looser than the cache action. Comments and test intent only; the accepted-input policy
and its tests are unchanged.
2026-11-18 03:51:54 +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 cd0795f15d gate: run platform legs on a pull request only when it can change them (select-os)
A select legs job (actions/select-platforms) runs the select-os legs on a pull
request only when a changed file is in a crate with platform cfg code or a crate
that depends on one (cargo metadata --no-deps and a scan of the sources), is part
of the build setup or select-paths, or lies outside every crate and is not
documentation. The select-label label (full-ci) and every other event run every
leg. Without select-os no select job runs and the matrix is os, as before.

On craft-libs today 37 of 177 crates have platform cfg code and 57 are affected
with their dependents; 39 of the last 80 merged pull requests would have run the
Linux leg only.
2026-11-17 18:55:31 +00:00
Martin BallandClaude Opus 5.5 f9e835af4f fix(rust-cache): pin v2.9.1 so Windows jobs save their cache (#249)
step-security/rust-cache v2.9.2 ships an ES-module bundle. Its bundled
minimatch 3 calls require('path'), which throws in an ES module, so it
falls back to '/' as the separator. On Windows no cache path then
matches and every save fails with "Path Validation Error". Windows legs
never saved a cache and built every dependency from scratch.

v2.9.1 is a CommonJS (ncc) bundle with the same inputs. Pin it
everywhere rust-cache is used and add a test that keeps every pin on
the action's commit and off v2.9.2.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01FypgCXtSjB6e5jmy9Uq7u8
2026-11-16 12:19:03 +00:00
Martin Ball 59d1ecc4ea Fix shared cache save policy and target paths (#253)
Disable Rust cache saves after failed runs and resolve CARGO_TARGET_DIR relative to the checkout. Use dated FreeBSD cache entries and skip a matching same-day save. Keep inherited-target tests independent of the caller environment.

Contributor: @benandez.

Validated with the passing hosted test job, 95 focused passes plus one existing csh skip, and four inherited-target tests. Native Windows/FreeBSD VM and live cache-service execution were not claimed.
2026-11-15 19:19:40 -06: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
FredApps debd222436 Merge pull request #155 from storytold/fix/house-rules-preserve-local-text
Preserve local instructions when updating house rules
2026-11-13 21:24:00 +01:00
FredApps 13ad478f3b fix(house-rules): preserve BOM and fenced marker examples 2026-11-13 21:18:10 +01:00
FredApps 4cb15cb9f4 Merge branch 'main' into fix/shared-appimage-cli-check
# Conflicts:
#	.github/workflows/test-freebsd.yml
2026-11-13 20:46:50 +01:00
FredApps ce1d914f7c Merge branch 'main' into fix/house-rules-preserve-local-text 2026-11-13 20:42:47 +01:00
FredApps 293de72429 release.yml: a FreeBSD cache a later release can restore, with the aarch64 cross output (#216)
The release FreeBSD jobs keyed their Cargo cache on toJSON(inputs), and
contributors-artifact is contributor-snapshot-<run id>-<attempt>, so every run
wrote an entry no other run could restore: on 11 Nov every release built FreeBSD
cold. The key now holds only the inputs that change the FreeBSD build (app name,
architecture, craft-fonts ref, FreeBSD release); dry-run is left out too, so a dry
run warms the cache a release restores. A test makes every new input pick a side.

The aarch64 job cross-compiles, and Cargo writes that output to
target/aarch64-unknown-freebsd/release, which the cache action never saved: only
the host build scripts in target/release were kept. The action takes the triple as
a new target input and saves and restores that directory too.
2026-11-12 07:25:29 +01:00
FredApps 5d42870ead apt: wait for cloud-init before rewriting the sources (#204)
During the ubuntu.com outage, cloud-init's apt_configure module (once per
instance, at boot) spent two 10-second DNS timeouts looking for a mirror
and then wrote ubuntu.sources from its template, after the job had
started. On those VMs configure-apt-mirrors had already pointed the
sources at its list: apt-get update fetched every index for that list,
cloud-init put the image's mirror list back, and apt-get install found
no indexes for it, so no Ubuntu package had a candidate (materialcraft's
Flatpak x86_64 job, the FreeBSD tests job on 26.04). A repro on 12
runners failed on 8, every round, and a file watcher caught cloud-init's
write landing mid-update.

wait-for-cloud-init.sh runs `cloud-init status --wait` (at most 300 s,
never failing the job) before configure-apt-mirrors and
install-riscv64-cross's select-mirrors.sh touch anything.
2026-11-11 17:57:29 +01:00
Dylan M. Taylor 95e8d67389 egress: allow *.kernel.org and *.dotsrc.org wherever apt mirrors are allowed (#203)
Block-mode Harden-Runner still flagged apt's lookups under these zones
(_https._tcp.mirrors.edge.kernel.org, _https._tcp.mirrors.dotsrc.org),
and apt failures are breaking CI across the org. Allow the whole zones on
443 next to the existing mirror hosts.
2026-11-11 11:20:38 -05:00
FredApps 3f541b8904 install-riscv64-cross: fall back to mirrors outside ubuntu.com (#202)
The release builds' Linux riscv64 job read amd64 from archive and
security.ubuntu.com and riscv64 from ports.ubuntu.com only. With no
ubuntu.com name resolving on the runners, apt spent 3m20s on failed
lookups and then found no libc6-dev:riscv64, so every app's release
failed there.

select-mirrors.sh now chooses one pair of mirrors for both architectures:
Ubuntu's own, then dotsrc (it carries both trees), then kernel.org with
TU Chemnitz's ports. It takes the first pair whose amd64 and riscv64
InRelease files answer for every suite with the same Date (Ubuntu signs
one Release for archive and ports), so Multi-Arch: same packages still
match. The image's own Ubuntu sources are disabled in that job: they
only added a second, lagging snapshot and, during the outage, the stall.

The riscv64 job runs Harden-Runner in audit mode, so release.yml needs
no allowlist change.
2026-11-11 17:01:34 +01:00
Dylan M. Taylor 3d49e352fa apt: stop SRV lookups; give the FreeBSD VM host the fallback mirrors (#200)
Harden-Runner blocked apt's SRV lookups (_https._tcp.mirrors.edge.kernel.org,
_https._tcp.mirrors.dotsrc.org): the allow lists name the hosts, not their
SRV records. configure-apt-mirrors now sets Acquire::EnableSrvRecords false;
apt connects to the hosts directly either way.

The FreeBSD workflow's VM action apt-installs QEMU on the host, which failed
during the ubuntu.com outage (sudo exit 100) and reached packages.microsoft.com.
Run configure-apt-mirrors first and drop the image's Microsoft source, which
the job never installs from.
2026-11-11 10:26:48 -05:00
FredApps d97dcd6dcf apt: fall back to mirrors outside ubuntu.com when it is down (#199)
On 11 Nov 2026 no ubuntu.com name resolved on the runners for about
half an hour. The images' mirror list (azure.archive, archive and
security.ubuntu.com) sits entirely in that zone, so every retry spent
its five minutes on 20-second lookups of the same dead names and the
SonarCloud archive builds failed with "downloading the packages failed
3 times".

configure-apt-mirrors points the image's Ubuntu sources at
/etc/apt/craft-apt-mirrors.txt: the image's mirrors in the image's
order, then mirrors.edge.kernel.org and mirrors.dotsrc.org (arm:
mirrors.dotsrc.org and ftp.tu-chemnitz.de). Each mirror is checked
first, in parallel; those that do not serve this release's InRelease
move to the end. install-apt-packages runs it before every network
attempt, and the plain apt-get steps (Flatpak, release, packaging lint,
RPM signing, Linux deps, FreeBSD test) run it before apt-get update.
Block-mode Harden-Runner lists allow the new hosts.
2026-11-11 16:21:03 +01:00
Dylan M. Taylor 4b47a2a3c7 Sonar: [[ in sign-linux.sh, a linear trailer regex in refresh-contributors (S7688, S8786) (#193)
Clears both open SonarCloud issues.

- `actions/draft-release/sign-linux.sh`: `[[ ]]` in place of `[ ]` for bash tests (SonarCloud shell:S7688). Every script has a bash shebang; no test uses `-a`/`-o`, escaped parentheses or an unquoted pattern on the right of `=`.
- `actions/refresh-contributors/refresh_contributors.py` `model()`: `([^<>]*)<([^<>]+)>` on the stripped trailer, with the name stripped after, in place of `\s*(.*?)\s*<([^<>]+)>\s*` (python:S8786, backtracking). Same result for every Git identity: a name can't hold `<` or `>`.
2026-11-10 18:45:19 -05:00
FredApps 4b23a68072 fix(packaging-lint): retry transient actionlint downloads (#176)
Bound archive and checksum download retries, including refused connections, while retaining HTTPS and SHA-256 validation. Report missing checksum entries using an exact archive filename lookup. Add nine real-curl regression tests for recovery, permanent failures, retry bounds and checksum validation.
2026-11-08 14:16:10 +01:00
Dylan M. Taylor 8e9b8b96c5 fix: support rpm 4.20+ signing and pin release job to ubuntu-24.04 (#175)
* fix(draft-release): use rpmsign --resign to support RPM 4.20+

* fix(release): run Draft GitHub Release on ubuntu-24.04
2026-11-07 20:48:33 -05:00
Dylan M. Taylor 2f46576245 feat: allow uploading assets to an existing published release (#164) (#165)
Add allow-published (default false) to draft-release. When true, draft-release
permits uploading assets to an existing published release without failing or
attempting to convert it to a draft with --draft.
2026-11-06 20:40:48 -05:00
Dylan M. Taylor aa106c86ee feat: allow additional Arch runtime dependencies (#161) 2026-11-06 19:33:10 -05:00
Dylan M. Taylor 489222f309 feat: optionally retain existing draft release assets (#160) 2026-11-06 19:24:50 -05:00
Dylan M. Taylor dd3d987521 feat: allow a custom draft release tag prefix (#159) 2026-11-06 16:06:01 -05:00
FredApps be28458a30 Harden house-rules markers and main ancestry checks 2026-11-06 19:16:25 +01:00
nnaannooandnnaannoo 13f3c2c99b release.yml: export each app's build variables from its env.sh, so a new app needs no change here (#148)
* release.yml: export each app's build variables from its env.sh, not a list

Eight release jobs set <APP>_VERSION, <APP>_BUILD_DATE and <APP>_BUILD_SHA for
every app by name (298 lines), and the FreeBSD VM step listed them all again,
so every new app meant editing this workflow. materialcraft and texturecraft
were never added: their packaging reads MATERIALCRAFT_* and TEXTURECRAFT_*,
so their release builds got no release version, date or commit, and a
dispatched run with a version override packaged them under Cargo.toml's.

actions/export-app-build-env reads the prefix the app's packaging/env.sh (or
packaging/common.sh) already declares in VERSION="${<PREFIX>_VERSION:-...}",
falling back to app-name in capitals, and writes the three variables to
GITHUB_ENV; its names output feeds the FreeBSD VM's envs. Each job runs it
right after checkout. On all 17 apps' env.sh it finds the prefix the old
list used.

Tests run the script on sample env.sh files and check release.yml sets no
app's variable by name, so the list can't come back.

* Export the build variables after the contributor snapshot, which must follow the checkout

test_contributor_refresh requires each build job to load the contributor snapshot directly after checkout, so the export step goes after it when a job has one. Also fix the line-break test passing a variable twice.

---------

Co-authored-by: nnaannoo <n4nosaur@gmail.com>
2026-11-06 07:36:30 -05:00
FredApps d2855b97d0 fix: preserve local text when updating house rules 2026-11-06 12:56:48 +01:00
FredAppsandCursor 3207fcf8ad Keep the house-rules rewrite on the checked AGENTS.md path.
The path is resolved and has to stay inside the named directory. The existing file's text is written back as text, so the path-traversal finding on that write is suppressed.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-11-06 11:42:33 +01:00
FredAppsandCursor 9a3db2d31d Validate house-rules paths and revisions before git or file access.
A checkout path and a recorded commit have to match a fixed pattern, and the standards path has to be one of the two known files. The per-block check is its own function.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-11-06 11:39:18 +01:00
FredAppsandCursor 70fc5d4964 Check that AGENTS.md copies the shared house rules.
The writer and the checker share one normalization. A rewritten digest does not make an edit pass, an intact older copy warns only when main has moved on, and a source that cannot be read is reported as could not check.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-11-06 11:34:30 +01:00
Dylan M. Taylor f2e6f2a639 fix(install-riscv64-cross): read amd64 from the primary mirror (#150)
The runner's amd64 mirror (azure.archive.ubuntu.com) lags ports.ubuntu.com, and
Multi-Arch: same packages must be the same version on both architectures. When
ports publishes a linux-libc-dev before the mirror does, apt cannot install
libc6-dev:riscv64 and reports a dependency that "is not going to be installed",
which fails the riscv64 build until the mirrors happen to catch up.

Point amd64 at archive.ubuntu.com for main and updates as the action already
does for security, so both architectures always offer matching versions.
2026-11-05 22:47:15 -05:00
nnaannooandKristian Myram 4d1066685f Add git-sources.yml: the shared "Git dependencies come from storytold" check (#147)
Eight apps paste the same 25-line job into ci.yml, nix.yml or release.yml (ten
copies): Cargo.lock exists and is up to date, no .cargo/config(.toml)
replaces, patches or overrides a source, and every git dependency comes from
github.com/storytold. Apps' workflows are meant to only call workflows here.

actions/check-git-sources holds the check as a tested script, and
git-sources.yml runs it on a credential-less checkout, so an app swaps its
job for one `uses:` line and keeps `needs: git-sources`. It reports every
problem rather than the first, as GitHub error annotations, and treats
unreadable TOML as a failure. On all 18 apps' current Cargo.lock and Cargo
config it agrees with the inline copy.

Co-authored-by: Kristian Myram <kmy@oresundsbron.com>
2026-11-05 09:13:01 -05:00