Skip to content

Commit 1eb79aa

Browse files
dukecat0webknjaz
andauthored
Integrate sphinx's linkcheck (#968)
Co-authored-by: Sviatoslav Sydorenko <wk.cvs.github@sydorenko.org.ua> Co-authored-by: Sviatoslav Sydorenko <webknjaz@redhat.com>
1 parent 6b49cd6 commit 1eb79aa

3 files changed

Lines changed: 25 additions & 2 deletions

File tree

.github/workflows/test.yml

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,13 @@ on: [push, pull_request]
44

55
jobs:
66
build:
7+
name: ${{ matrix.noxenv }}
78
runs-on: ubuntu-latest
9+
strategy:
10+
matrix:
11+
noxenv:
12+
- build
13+
- linkcheck
814

915
steps:
1016
- uses: actions/checkout@v2
@@ -27,6 +33,6 @@ jobs:
2733
run: |
2834
python -m pip install --upgrade nox virtualenv
2935
30-
- name: Nox build
36+
- name: Nox ${{ matrix.noxenv }}
3137
run: |
32-
python -m nox -s build
38+
python -m nox -s ${{ matrix.noxenv }}

noxfile.py

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,3 +52,16 @@ def build(session, autobuild=False):
5252
def preview(session):
5353
session.install("sphinx-autobuild")
5454
build(session, autobuild=True)
55+
56+
57+
@nox.session(py="3")
58+
def linkcheck(session):
59+
session.install("-r", "requirements.txt")
60+
session.run(
61+
"sphinx-build",
62+
"-b", "linkcheck", # use linkcheck builder
63+
"--color",
64+
"-n", "-W", "--keep-going", # be strict
65+
"source", # where the rst files are located
66+
"build", # where to put the check output
67+
)

source/conf.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -381,6 +381,10 @@
381381
'user': (f'{github_sponsors_url}/%s', '@'), # noqa: WPS323
382382
}
383383

384+
linkcheck_ignore = [
385+
"http://localhost:\d+",
386+
]
387+
384388
# Example configuration for intersphinx: refer to the Python standard library.
385389
intersphinx_mapping = {
386390
'python': ('https://docs.python.org/3', None),

0 commit comments

Comments
 (0)