From a4ccebade7aaace0cf990bd4cfbbc189d5cd4285 Mon Sep 17 00:00:00 2001 From: Harald Nezbeda Date: Thu, 3 Oct 2019 20:49:50 +0200 Subject: [PATCH 1/4] Add ci stage to test for broken links in documentation --- .github/workflows/main.yml | 24 +++++++++++++++++++++ requirements/requirements-documentation.txt | 3 +++ 2 files changed, 27 insertions(+) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index f245f69644..cf4fbd4d9a 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -56,3 +56,27 @@ jobs: - name: Upload coverage run: | codecov -e TOXENV,DJANGO + + test-docs: + name: Test documentation links + runs-on: ubuntu-20.04 + steps: + - uses: actions/checkout@v3 + + - uses: actions/setup-python@v4 + with: + python-version: '3.9' + + - name: Install dependencies + run: pip install -r requirements/requirements-documentation.txt + + # Start mkdocs server and wait for it to be ready + - run: mkdocs serve & + - run: WAIT_TIME=0 && until nc -vzw 2 localhost 8000 || [ $WAIT_TIME -eq 5 ]; do sleep $(( WAIT_TIME++ )); done + - run: if [ $WAIT_TIME == 5 ]; then echo cannot start mkdocs server on http://localhost:8000; exit 1; fi + + - name: Check links + continue-on-error: true + run: pylinkvalidate.py -P http://localhost:8000/ + + - run: echo "Done" diff --git a/requirements/requirements-documentation.txt b/requirements/requirements-documentation.txt index cf2dc26e88..bce03abc5b 100644 --- a/requirements/requirements-documentation.txt +++ b/requirements/requirements-documentation.txt @@ -1,3 +1,6 @@ # MkDocs to build our documentation. mkdocs>=1.1.2,<1.2 jinja2>=2.10,<3.1.0 # contextfilter has been renamed + +# pylinkvalidator to check for broken links in documentation. +pylinkvalidator==0.3 From e45abe99ad5440f649a38d1232cbffc2fab5edd4 Mon Sep 17 00:00:00 2001 From: Ryan P Kilby Date: Wed, 11 Mar 2020 13:29:52 -0700 Subject: [PATCH 2/4] Add docs validation to release process --- docs/community/project-management.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/docs/community/project-management.md b/docs/community/project-management.md index 293c65e246..92132ae7e6 100644 --- a/docs/community/project-management.md +++ b/docs/community/project-management.md @@ -112,6 +112,9 @@ The following template should be used for the description of the issue, and serv - [ ] `docs` Python & Django versions - [ ] Update the translations from [transifex](https://www.django-rest-framework.org/topics/project-management/#translations). - [ ] 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). + - [ ] Ensure documentation validates + - Build and serve docs `mkdocs serve` + - Validate links `pylinkvalidate.py -P http://127.0.0.1:8000` - [ ] Confirm with @tomchristie that release is finalized and ready to go. - [ ] Ensure that release date is included in pull request. - [ ] Merge the release pull request. From 7fce41ec2cdb41e44639cb9abc1a34591ffccc31 Mon Sep 17 00:00:00 2001 From: Asif Saif Uddin Date: Tue, 15 Aug 2023 11:05:03 +0600 Subject: [PATCH 3/4] Update .github/workflows/main.yml --- .github/workflows/main.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index cf4fbd4d9a..fe9610ce31 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -59,7 +59,7 @@ jobs: test-docs: name: Test documentation links - runs-on: ubuntu-20.04 + runs-on: ubuntu-22.04 steps: - uses: actions/checkout@v3 From 4476b7eabc22ca4384a0fd85ef73e8ea648ea2ea Mon Sep 17 00:00:00 2001 From: Asif Saif Uddin Date: Tue, 15 Aug 2023 11:05:10 +0600 Subject: [PATCH 4/4] Update .github/workflows/main.yml --- .github/workflows/main.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index fe9610ce31..5ffca54f93 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -65,7 +65,7 @@ jobs: - uses: actions/setup-python@v4 with: - python-version: '3.9' + python-version: '3.10' - name: Install dependencies run: pip install -r requirements/requirements-documentation.txt