Skip to content

Commit 21cc480

Browse files
committed
Add ci stage to test for broken links in documentation
1 parent da92888 commit 21cc480

File tree

2 files changed

+28
-1
lines changed

2 files changed

+28
-1
lines changed

.github/workflows/main.yml

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,3 +56,27 @@ jobs:
5656
- name: Upload coverage
5757
run: |
5858
codecov -e TOXENV,DJANGO
59+
60+
test-docs:
61+
name: Test documentation links
62+
runs-on: ubuntu-20.04
63+
steps:
64+
- uses: actions/checkout@v3
65+
66+
- uses: actions/setup-python@v4
67+
with:
68+
python-version: '3.11'
69+
70+
- name: Install dependencies
71+
run: pip install -r requirements/requirements-documentation.txt
72+
73+
# Start mkdocs server and wait for it to be ready
74+
- run: mkdocs serve &
75+
- run: WAIT_TIME=0 && until nc -vzw 2 localhost 8000 || [ $WAIT_TIME -eq 5 ]; do sleep $(( WAIT_TIME++ )); done
76+
- run: if [ $WAIT_TIME == 5 ]; then echo cannot start mkdocs server on http://localhost:8000; exit 1; fi
77+
78+
- name: Check links
79+
continue-on-error: true
80+
run: pylinkvalidate.py -P http://localhost:8000/
81+
82+
- run: echo "Done"
Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
11
# MkDocs to build our documentation.
2-
mkdocs>=1.1.2,<1.2
2+
mkdocs>=1.3,<1.4
33
jinja2>=2.10,<3.1.0 # contextfilter has been renamed
4+
5+
# pylinkvalidator to check for broken links in documentation.
6+
pylinkvalidator==0.3

0 commit comments

Comments
 (0)