Skip to content

Commit a2430a8

Browse files
nezharrpkilbyauvipy
authored
Add docs validation to release process (#6967)
* Add ci stage to test for broken links in documentation * Add docs validation to release process * Update .github/workflows/main.yml * Update .github/workflows/main.yml --------- Co-authored-by: Ryan P Kilby <[email protected]> Co-authored-by: Asif Saif Uddin <[email protected]>
1 parent 6ebe6f2 commit a2430a8

File tree

3 files changed

+30
-0
lines changed

3 files changed

+30
-0
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-22.04
63+
steps:
64+
- uses: actions/checkout@v3
65+
66+
- uses: actions/setup-python@v4
67+
with:
68+
python-version: '3.10'
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"

docs/community/project-management.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -112,6 +112,9 @@ The following template should be used for the description of the issue, and serv
112112
- [ ] `docs` Python & Django versions
113113
- [ ] Update the translations from [transifex](https://www.django-rest-framework.org/topics/project-management/#translations).
114114
- [ ] Ensure the pull request increments the version to `*.*.*` in [`restframework/__init__.py`](https://github.com/encode/django-rest-framework/blob/master/rest_framework/__init__.py).
115+
- [ ] Ensure documentation validates
116+
- Build and serve docs `mkdocs serve`
117+
- Validate links `pylinkvalidate.py -P http://127.0.0.1:8000`
115118
- [ ] Confirm with @tomchristie that release is finalized and ready to go.
116119
- [ ] Ensure that release date is included in pull request.
117120
- [ ] Merge the release pull request.
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
11
# MkDocs to build our documentation.
22
mkdocs>=1.1.2,<1.2
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)