]> git.ipfire.org Git - thirdparty/vim.git/commitdiff
CI: Add Lychee CI test to check for broken links
authorDamien Lejay <damien@lejay.be>
Sun, 10 Aug 2025 08:28:58 +0000 (10:28 +0200)
committerChristian Brabandt <cb@256bit.org>
Sun, 10 Aug 2025 08:28:58 +0000 (10:28 +0200)
closes: #17879

Signed-off-by: Damien Lejay <damien@lejay.be>
Signed-off-by: Christian Brabandt <cb@256bit.org>
.github/workflows/link-check.yml [new file with mode: 0644]
Filelist
ci/lychee.toml [new file with mode: 0644]

diff --git a/.github/workflows/link-check.yml b/.github/workflows/link-check.yml
new file mode 100644 (file)
index 0000000..e16515f
--- /dev/null
@@ -0,0 +1,15 @@
+# .github/workflows/link-check.yml
+name: Check Links
+on:
+  workflow_dispatch:
+  schedule:
+    - cron: '0 3 * * 0' # Every Sunday at 03:00 UTC
+jobs:
+  lychee:
+    runs-on: ubuntu-latest
+    steps:
+      - uses: actions/checkout@v4
+      - name: Run Lychee
+        uses: lycheeverse/lychee-action@v2
+        with:
+          args: --verbose --config ci/lychee.toml .
index 5153ded57d0c3571c6bf37a46a0aadbcba3abac6..b52506d756b04720f81f8c92f4f91c539bb39e99 100644 (file)
--- a/Filelist
+++ b/Filelist
@@ -12,6 +12,7 @@ SRC_ALL =     \
                .github/workflows/ci.yml \
                .github/workflows/codeql-analysis.yml \
                .github/workflows/coverity.yml \
+               .github/workflows/link-check.yml \
                .github/actions/test_artifacts/action.yml \
                .github/dependabot.yml \
                .gitignore \
@@ -24,6 +25,7 @@ SRC_ALL =     \
                ci/config.mk*.sed \
                ci/if_ver*.vim \
                ci/if_feat_check.vim \
+               ci/lychee.toml \
                ci/setup-xvfb.sh \
                ci/setup-sway.sh \
                ci/remove_snap.sh \
diff --git a/ci/lychee.toml b/ci/lychee.toml
new file mode 100644 (file)
index 0000000..4077e77
--- /dev/null
@@ -0,0 +1,47 @@
+#############################  Runtime  #############################
+
+# Reasonable concurrency to avoid rate-limiting small hosts.
+max_concurrency = 14
+
+# File extensions to scan
+extensions = ["c", "h", "md", "html", "txt"]
+
+#############################  Requests  ############################
+
+# Accepted status codes
+# - Include 429 (Too Many Requests) to avoid marking throttled links as dead.
+accept = ["100..=103", "200..=299", "429"]
+
+# Retry each request a few times on transient network errors
+retries = 2
+retry_wait_time = 2
+
+# Timeout per request in seconds
+timeout = 20
+
+#############################  Exclusions  ##########################
+
+exclude = [
+  '^https?://sys/file$',
+  '^file://.*',
+  '^https?://(www\.)?badges\.debian\.net/.*$',
+  '^https?://(www\.)?repology\.org/.*$',
+  '^https?://scan\.coverity\.com/.*$',
+  '^https?://(www\.)?img\.shields\.io/.*$',
+  '^https?://(www\.)?fossies\.org/.*$',
+  '^https?://(www\.)?adobe\.com.*$',
+  '^https?://(www\.)?google\.com.*$',
+  '^https?://(www\.)?forum\.vmssoftware\.com/.*$',
+  '^http://vim\.sourceforge\.net/scripts/script\.php\?script_id=40$',
+  '^https://is\.gd/.*$',
+  '^https://wiki\.contextgarden\.net/Vim$',
+  '^https://github\.com/you/foobar\.git$',
+  '^https?://flatassembler\.net',
+  '^https?://www\.fleiner\.com/vim/download.html',
+]
+
+# Lychee only reads UTF-8 files
+exclude_path = [
+  'src/po',
+  'src/testdir',
+]