Skip to content

Commit e324651

Browse files
dlejaychrisbra
authored andcommitted
CI: Add Lychee CI test to check for broken links
closes: #17879 Signed-off-by: Damien Lejay <[email protected]> Signed-off-by: Christian Brabandt <[email protected]>
1 parent 32d6bd6 commit e324651

3 files changed

Lines changed: 64 additions & 0 deletions

File tree

.github/workflows/link-check.yml

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
# .github/workflows/link-check.yml
2+
name: Check Links
3+
on:
4+
workflow_dispatch:
5+
schedule:
6+
- cron: '0 3 * * 0' # Every Sunday at 03:00 UTC
7+
jobs:
8+
lychee:
9+
runs-on: ubuntu-latest
10+
steps:
11+
- uses: actions/checkout@v4
12+
- name: Run Lychee
13+
uses: lycheeverse/lychee-action@v2
14+
with:
15+
args: --verbose --config ci/lychee.toml .

Filelist

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ SRC_ALL = \
1212
.github/workflows/ci.yml \
1313
.github/workflows/codeql-analysis.yml \
1414
.github/workflows/coverity.yml \
15+
.github/workflows/link-check.yml \
1516
.github/actions/test_artifacts/action.yml \
1617
.github/dependabot.yml \
1718
.gitignore \
@@ -24,6 +25,7 @@ SRC_ALL = \
2425
ci/config.mk*.sed \
2526
ci/if_ver*.vim \
2627
ci/if_feat_check.vim \
28+
ci/lychee.toml \
2729
ci/setup-xvfb.sh \
2830
ci/setup-sway.sh \
2931
ci/remove_snap.sh \

ci/lychee.toml

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
############################# Runtime #############################
2+
3+
# Reasonable concurrency to avoid rate-limiting small hosts.
4+
max_concurrency = 14
5+
6+
# File extensions to scan
7+
extensions = ["c", "h", "md", "html", "txt"]
8+
9+
############################# Requests ############################
10+
11+
# Accepted status codes
12+
# - Include 429 (Too Many Requests) to avoid marking throttled links as dead.
13+
accept = ["100..=103", "200..=299", "429"]
14+
15+
# Retry each request a few times on transient network errors
16+
retries = 2
17+
retry_wait_time = 2
18+
19+
# Timeout per request in seconds
20+
timeout = 20
21+
22+
############################# Exclusions ##########################
23+
24+
exclude = [
25+
'^https?://sys/file$',
26+
'^file://.*',
27+
'^https?://(www\.)?badges\.debian\.net/.*$',
28+
'^https?://(www\.)?repology\.org/.*$',
29+
'^https?://scan\.coverity\.com/.*$',
30+
'^https?://(www\.)?img\.shields\.io/.*$',
31+
'^https?://(www\.)?fossies\.org/.*$',
32+
'^https?://(www\.)?adobe\.com.*$',
33+
'^https?://(www\.)?google\.com.*$',
34+
'^https?://(www\.)?forum\.vmssoftware\.com/.*$',
35+
'^http://vim\.sourceforge\.net/scripts/script\.php\?script_id=40$',
36+
'^https://is\.gd/.*$',
37+
'^https://wiki\.contextgarden\.net/Vim$',
38+
'^https://github\.com/you/foobar\.git$',
39+
'^https?://flatassembler\.net',
40+
'^https?://www\.fleiner\.com/vim/download.html',
41+
]
42+
43+
# Lychee only reads UTF-8 files
44+
exclude_path = [
45+
'src/po',
46+
'src/testdir',
47+
]

0 commit comments

Comments
 (0)