Skip to content

Commit d47e026

Browse files
authored
Migrate link checks to GitHub actions only with lychee for main workflows (#45)
Fixes link checking issues failing on GitHub actions and failing to run locally by removing the local ability (lychee requires non-straightforward install pathways based on development OS)
1 parent 698af1b commit d47e026

File tree

5 files changed

+41
-50
lines changed

5 files changed

+41
-50
lines changed

.github/workflows/development.yml

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -37,22 +37,6 @@ jobs:
3737
- name: Run quality checks
3838
run: tox -e types
3939

40-
link-checks:
41-
runs-on: ubuntu-latest
42-
strategy:
43-
matrix:
44-
python: ["3.9"]
45-
steps:
46-
- uses: actions/checkout@v4
47-
- name: Set up Python
48-
uses: actions/setup-python@v5
49-
with:
50-
python-version: ${{ matrix.python }}
51-
- name: Install dependencies
52-
run: pip install tox
53-
- name: Run link checks
54-
run: tox -e links
55-
5640
precommit-checks:
5741
runs-on: ubuntu-latest
5842
strategy:

.github/workflows/main.yml

Lines changed: 23 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ jobs:
3838
- name: Run quality checks
3939
run: tox -e types
4040

41-
link-checks:
41+
precommit-checks:
4242
runs-on: ubuntu-latest
4343
strategy:
4444
matrix:
@@ -50,25 +50,33 @@ jobs:
5050
with:
5151
python-version: ${{ matrix.python }}
5252
- name: Install dependencies
53-
run: pip install tox
54-
- name: Run link checks
55-
run: tox -e links
53+
run: pip install pre-commit
54+
- name: Run pre-commit checks
55+
run: pre-commit run --all-files
5656

57-
precommit-checks:
57+
link-checks:
5858
runs-on: ubuntu-latest
59-
strategy:
60-
matrix:
61-
python: ["3.9"]
59+
permissions:
60+
issues: write
6261
steps:
6362
- uses: actions/checkout@v4
64-
- name: Set up Python
65-
uses: actions/setup-python@v5
63+
- name: Link Checker
64+
id: lychee
65+
uses: lycheeverse/lychee-action@v2
6666
with:
67-
python-version: ${{ matrix.python }}
68-
- name: Install dependencies
69-
run: pip install pre-commit
70-
- name: Run pre-commit checks
71-
run: pre-commit run --all-files
67+
fail: false
68+
- name: Create Issues
69+
if: steps.lychee.outputs.exit_code != '0'
70+
uses: peter-evans/create-issue-from-file@v5
71+
with:
72+
title: Link Checker Report
73+
content-filepath: ./lychee/out.md
74+
labels: report, automated issue
75+
- name: Fail on Issues
76+
if: steps.lychee.outputs.exit_code != '0'
77+
run: |
78+
echo "Link Checker found issues. Please check the created issue for details."
79+
exit 1
7280
7381
unit-tests:
7482
runs-on: ubuntu-latest

.github/workflows/nightly.yml

Lines changed: 18 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -7,19 +7,27 @@ on:
77
jobs:
88
link-checks:
99
runs-on: ubuntu-latest
10-
strategy:
11-
matrix:
12-
python: ["3.9"]
10+
permissions:
11+
issues: write
1312
steps:
1413
- uses: actions/checkout@v4
15-
- name: Set up Python
16-
uses: actions/setup-python@v5
14+
- name: Link Checker
15+
id: lychee
16+
uses: lycheeverse/lychee-action@v2
1717
with:
18-
python-version: ${{ matrix.python }}
19-
- name: Install dependencies
20-
run: pip install tox
21-
- name: Run link checks
22-
run: tox -e links
18+
fail: false
19+
- name: Create Issues
20+
if: steps.lychee.outputs.exit_code != '0'
21+
uses: peter-evans/create-issue-from-file@v5
22+
with:
23+
title: Link Checker Report
24+
content-filepath: ./lychee/out.md
25+
labels: report, automated issue
26+
- name: Fail on Issues
27+
if: steps.lychee.outputs.exit_code != '0'
28+
run: |
29+
echo "Link Checker found issues. Please check the created issue for details."
30+
exit 1
2331
2432
unit-tests:
2533
runs-on: ubuntu-latest

src/.lycheeignore

Whitespace-only changes.

tox.ini

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -61,15 +61,6 @@ commands =
6161
mypy --check-untyped-defs
6262

6363

64-
[testenv:links]
65-
description = Run link checks for root and docs markdown files
66-
deps =
67-
.[dev]
68-
commands =
69-
mkdocs-linkcheck ./
70-
mkdocs-linkcheck docs/
71-
72-
7364
[testenv:build]
7465
description = Build the project
7566
deps =

0 commit comments

Comments
 (0)