Skip to content

Commit 3c98512

Browse files
authored
Check links using lychee (#319)
Recently, our check_links workflow was failing very often, apparently GitHub has introduced new rate limits. I played around with [lychee](https://github.com/lycheeverse/lychee-action), a tool specifically made for link checking, which supports caching and even understands local links in Markdown and RST files.
1 parent 99ac21d commit 3c98512

File tree

3 files changed

+42
-82
lines changed

3 files changed

+42
-82
lines changed

.github/helpers/check_urls.sh

Lines changed: 0 additions & 71 deletions
This file was deleted.

.github/workflows/check_links.yml

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
name: Check Links
2+
on:
3+
workflow_dispatch:
4+
pull_request:
5+
push:
6+
branches:
7+
- main
8+
9+
jobs:
10+
check_links:
11+
runs-on: ubuntu-latest
12+
steps:
13+
- uses: actions/checkout@v4
14+
- name: Restore lychee cache
15+
id: restore-cache
16+
uses: actions/cache/restore@v4
17+
with:
18+
path: .lycheecache
19+
key: cache-lychee-${{ github.run_id }}-${{ github.run_attempt }}
20+
restore-keys: cache-lychee-
21+
- name: Link Checker
22+
id: lychee
23+
uses: lycheeverse/lychee-action@v2
24+
with:
25+
fail: true
26+
args: >
27+
--verbose
28+
--no-progress
29+
--cache
30+
--cache-exclude-status '429, 403, 404, 502'
31+
--max-cache-age 2d
32+
--exclude '^http://192\.168\.56\.101'
33+
--exclude 'kernel\.org\/pub\/linux\/kernel'
34+
--exclude 'releases/download/v\$%7BURCAP_VERSION%7D/externalcontrol-\$%7BURCAP_VERSION%7D\.jar'
35+
--max-concurrency 1
36+
'./**/*.md' './**/*.html' './**/*.rst' './**/*.cpp' './**/*.h' './**/*.py'
37+
- name: Save lychee cache
38+
uses: actions/cache/save@v4
39+
if: always()
40+
with:
41+
path: .lycheecache
42+
key: ${{ steps.restore-cache.outputs.cache-primary-key }}

.github/workflows/ci.yml

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -126,14 +126,3 @@ jobs:
126126
fail_ci_if_error: true
127127
token: ${{ secrets.CODECOV_TOKEN }}
128128
flags: start_ursim
129-
130-
check_links:
131-
runs-on: ubuntu-latest
132-
steps:
133-
- uses: actions/checkout@v4
134-
- name: Check URLs
135-
run: |
136-
.github/helpers/check_urls.sh \
137-
-d ".git build CMakeModules debian" \
138-
-f "package.xml urcl_architecture.svg trajectory_interface.svg dataflow.graphml start_ursim.sh ursim_docker.rst" \
139-
-p "vnc\.html opensource\.org\/licenses\/BSD-3-Clause kernel\.org\/pub\/linux\/kernel"

0 commit comments

Comments
 (0)