Skip to content

Worktrunk is a CLI for Git worktree management, designed for parallel AI agent workflows

ci: move lychee link check to the nightly workflow (#3402)

Maximilian Roosc8de0d872a90
diff --git a/.claude/skills/running-tend/SKILL.md b/.claude/skills/running-tend/SKILL.md
index 81b7484d7..8984389b3 100644
--- a/.claude/skills/running-tend/SKILL.md
+++ b/.claude/skills/running-tend/SKILL.md
@@ -108,12 +108,13 @@ Before opening a `fix/ci-*` PR, classify the failure:
**Non-required β‰  transient.** A non-required job (e.g. `collect affected coverage`, `affected tests (linux, advisory)`) can fail from a real regression. The required/non-required distinction is about merge-blocking, not about how the failure is classified. If a deterministic build error (`error[E...]`, "binary not found", "ambiguous candidates", missing target) repeats across consecutive runs of the same shape, it's a real regression even when the job is advisory. Reserve "transient" for non-deterministic causes: `BrokenPipe`, `connection reset`, runner disk full, GitHub API timeouts, host-availability blips.
**Lychee link-check timeouts are always transient** unless the same URL has
-failed on at least two separate runs within the last few days. `.config/lychee.toml`
+failed on at least two separate runs within the last few days. The check runs
+as the `link-check` job in the `nightly` workflow. `.config/lychee.toml`
already sets `max_retries = 6` and lists known-unreliable hosts; one timeout
is not enough evidence to extend that list. Signals you have a transient
failure, not a broken link:
-- The previous CI run on the same or a nearby commit passed.
+- The previous run on the same or a nearby commit passed.
- Only `[TIMEOUT]` is reported (not `404`/`403`/`410`).
- The URL is reachable from a local `curl`.
diff --git a/.config/wt.toml b/.config/wt.toml
index dfaa0b59e..00f46fd77 100644
--- a/.config/wt.toml
+++ b/.config/wt.toml
@@ -21,7 +21,7 @@ sync = 'if [ "{{ target }}" = "main" ]; then git pull && git push; fi'
# `--workspace` reconciles the lock against the manifests only; plain
# `cargo update --locked` would also fail on dependencies merely behind latest.
lockfile = "cargo update --workspace --locked"
-pre-commit = 'if [ -n "$MSYSTEM" ]; then SKIP=lychee-system pre-commit run --all-files; else pre-commit run --all-files; fi'
+pre-commit = "pre-commit run --all-files"
insta = """RUSTFLAGS='-D warnings' NEXTEST_NO_INPUT_HANDLER=1 cargo insta test --test-runner nextest --dnd --check $([ "$(uname)" = 'Linux' ] && echo '--unreferenced reject') --features shell-integration-tests"""
doctest = "RUSTDOCFLAGS='-Dwarnings' cargo test --doc"
doc = "RUSTDOCFLAGS='-Dwarnings' cargo doc --no-deps --document-private-items"
diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml
index 11f5bf18c..824ad7d50 100644
--- a/.github/workflows/ci.yaml
+++ b/.github/workflows/ci.yaml
@@ -23,8 +23,6 @@ env:
# with no benefit. Especially impactful on Windows where I/O is the bottleneck.
CARGO_INCREMENTAL: 0
RUSTFLAGS: -C debuginfo=0
- # Authenticate lychee requests to GitHub to avoid rate limiting
- GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
jobs:
lint:
@@ -41,12 +39,6 @@ jobs:
cache-bin: "false"
save-if: ${{ github.ref == 'refs/heads/main' }}
- - name: Install lychee
- uses: baptiste0928/cargo-install@v3
- with:
- crate: lychee
- version: "=0.24.2"
-
- name: πŸ” Pre-commit hooks
uses: pre-commit/[email protected]
diff --git a/.github/workflows/nightly.yaml b/.github/workflows/nightly.yaml
index 75a9a157a..035e08d19 100644
--- a/.github/workflows/nightly.yaml
+++ b/.github/workflows/nightly.yaml
@@ -9,6 +9,7 @@ name: nightly
# - minimal-versions: cargo check against minimum-version dep resolution
# - nix-flake: nix flake check (packaging-environment bugs, motivated by #2624)
# - crate-build: build the crates.io archive with no `.git` (faithful #3123 repro)
+# - link-check: lychee over tracked .md/.txt files (external-link volatility)
#
# Runs daily on cron, on demand via workflow_dispatch, on pushes to main that
# touch dependency or toolchain files, and on PRs that either (a) touch the
@@ -352,6 +353,35 @@ jobs:
- name: πŸ§ͺ Build crates.io archive without .git
run: cargo test --test integration crate_io_archive_builds_and_versions_without_git -- --ignored
+ link-check:
+ # The pre-commit `lychee-system` hook (manual stage) over every tracked
+ # .md/.txt file. It lives here, not in PR CI: link health depends on the
+ # outside world (429s, bot-blocking, transient outages), so it was the
+ # flakiest PR check β€” and link rot isn't PR-correlated anyway; links
+ # break when external sites change, not when code does. A failure opens
+ # the nightly-failure issue instead of reddening an unrelated PR.
+ needs: gate
+ if: needs.gate.outputs.run == 'true'
+ runs-on: ubuntu-24.04
+ env:
+ # Authenticate lychee requests to GitHub to avoid rate limiting
+ GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
+ steps:
+ - name: πŸ“‚ Checkout code
+ uses: actions/checkout@v7
+
+ - name: Install lychee
+ uses: baptiste0928/cargo-install@v3
+ with:
+ crate: lychee
+ version: "=0.24.2"
+
+ - name: πŸ”— Check links
+ # Through pre-commit so file selection (the `files` regex, symlink
+ # exclusion) has one definition; the manual stage keeps it out of the
+ # PR `lint` job and local `pre-commit run --all-files`.
+ run: pipx run pre-commit run lychee-system --all-files --hook-stage manual
+
nix-flake:
# Build and test under the nix sandbox so packaging-environment bugs
# surface before a release / nixpkgs maintainer hits them. See #2624 for
@@ -390,6 +420,7 @@ jobs:
- minimal-versions
- nix-flake
- crate-build
+ - link-check
if: always() && contains(needs.*.result, 'failure') && github.repository_owner == 'max-sixty' && github.event_name == 'schedule'
runs-on: ubuntu-24.04
permissions:
diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml
index 1a1689840..7f521587e 100644
--- a/.pre-commit-config.yaml
+++ b/.pre-commit-config.yaml
@@ -33,7 +33,12 @@ repos:
hooks:
# Check links using .config/lychee.toml exclusions
# Uses lychee-system (requires `cargo install lychee`) to avoid /bin/bash dependency on Windows
+ #
+ # Manual stage only: link health depends on external sites (429s,
+ # bot-blocking, link rot), so it runs as the `link-check` job in the
+ # nightly workflow, not on every commit/PR.
- id: lychee-system
+ stages: [manual]
files: '\.(md|txt)$'
args:
- --config=.config/lychee.toml
@@ -84,6 +89,5 @@ repos:
ci:
# pre-commit.ci doesn't have Rust toolchain, so skip Rust-specific hooks.
- # Network access also isn't supported, so skip lychee-system.
- skip: [fmt, clippy, lychee-system, cargo-lock]
+ skip: [fmt, clippy, cargo-lock]
autoupdate_commit_msg: "chore: pre-commit autoupdate"