Skip to content

ci(prek): run lychee from a pinned prebuilt release in CI - #2187

Merged
potiuk merged 2 commits into
apache:mainfrom
potiuk:ci/lychee-prebuilt
Nov 18, 2026
Merged

potiuk merged 2 commits into
apache:mainfrom
potiuk:ci/lychee-prebuilt

Conversation

@potiuk

@potiuk potiuk commented Nov 18, 2026 •

Copy link
Copy Markdown
Member

Summary

Follow-up to #2185, which merged from its first commit only. This PR also carries that PR's second commit, the cache-path fix below.

The lychee hook is language: rust, so CI had prek cargo install lychee: a multi-minute compile on ubuntu-slim's single vCPU, and the largest part of the hook-environment cache every run restores (#2175).

  • Make ci(prek): keep the hook-environment cache small enough for ubuntu-slim #2185's download-cache exclusion take effect. actions/cache tars each matched path whole and applies an exclusion only to paths the glob matched on its own, so with the bare ~/.cache/prek listed, !~/.cache/prek/cache matches nothing and prek's download caches stay in the archive. The path is now ~/.cache/prek/*.
  • CI runs a pinned prebuilt lychee. A new step downloads lychee 0.24.2 (the version prek builds today) as the static musl release, checks it against the SHA-256 GitHub reports for that asset, puts it on PATH, and the link-check step runs lychee --config .lychee.toml --no-progress ., the hook's own arguments. No new action is involved, so nothing new needs the ASF action allowlist.
  • No Rust env in CI any more. The Run prek step already skips lychee, and the dedicated step no longer goes through prek, so prek never builds the Rust env on the runner.
  • Fresh cache prefix. prek cache gc keeps the envs of every hook the config names, so under the previous prefix restore-keys would carry the old Rust env forward indefinitely. The key moves from ci(prek): keep the hook-environment cache small enough for ubuntu-slim #2185's prek-v2- to prek-v3-, which costs one more cold build of the remaining envs.
  • Contributors are unaffected. The local hook still builds lychee through prek. The hook's comment and the workflow both note that its arguments must stay in step.

Type of change

  • CI / dev loop (prek, workflows, validators)

Test plan

  • prek run on the changed files and zizmor pass (no findings)
  • The pinned digest is the one GitHub's release API reports for lychee-x86_64-unknown-linux-musl.tar.gz (v0.24.2)
  • CI on this PR: the install step verifies the checksum and prints lychee 0.24.2, and the link check passes

Notes for reviewers (optional)

A version bump is now a two-line change (LYCHEE_VERSION, LYCHEE_SHA256), and the local hook, being unpinned cli:lychee, can run a newer lychee than CI.
Pinning the hook to the same version would keep them aligned; left out here to keep this PR to CI.

Linked issues

Refs #2175

🤖 Generated with Claude Code

@potiuk potiuk added the family:ci .github workflows, prek, validators label Nov 18, 2026
actions/cache tars each matched path whole and applies an exclusion only
to paths the glob matched on its own. With the bare `~/.cache/prek`
directory listed, `!~/.cache/prek/cache` matched nothing, so prek's
download caches stayed in the archive. Listing the directory's entries
(`~/.cache/prek/*`) lets the exclusion drop `cache`.

Found by the pre-PR adversarial review.

Generated-by: Claude Opus 5
The lychee hook is `language: rust`, so CI had prek `cargo install` it: a
multi-minute compile on ubuntu-slim's single vCPU, and the largest part
of the hook-environment cache the job restores on every run (apache#2175).

CI now downloads lychee 0.24.2's static musl release, checks it against
the SHA-256 GitHub reports for the asset, and runs it with the hook's own
arguments. No new action is involved. Since CI no longer runs the hook,
prek builds no Rust environment there; the cache key moves to a `v3`
prefix so restore-keys stops carrying the old one forward. Contributors still
run the hook locally through prek; both places note that the arguments
must stay in step.

Generated-by: Claude Opus 5
@potiuk
potiuk force-pushed the ci/lychee-prebuilt branch from db09312 to 7ae681f Compare November 18, 2026 04:58
@potiuk
potiuk merged commit 5b0f368 into apache:main Nov 18, 2026
11 of 12 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

family:ci .github workflows, prek, validators

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant