Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Check external links in CI #100

Merged
merged 4 commits into from
Dec 14, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Build documentation
name: Check documentation

on:
push:
Expand All @@ -8,6 +8,7 @@ on:

jobs:
docs:
name: Build documentation & check links
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2.3.4
Expand All @@ -17,8 +18,11 @@ jobs:
- run: |
pip install --constraint=.github/workflows/constraints.txt pip
pip install --constraint=.github/workflows/constraints.txt nox
- run: nox --force-color --session=docs
- name: Build documentation
run: nox --force-color --session=docs
- uses: actions/upload-artifact@v2
with:
name: docs
path: docs/_build
- name: Check links
run: nox --force-color --session=linkcheck
1 change: 1 addition & 0 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,3 +22,4 @@
"fixed_sidebar": "true",
"sidebar_width": "250px",
}
linkcheck_ignore = ["codeofconduct.html"]
16 changes: 16 additions & 0 deletions noxfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@
import nox
from nox.sessions import Session

nox.options.sessions = (
"linkcheck",
)

@nox.session
def docs(session: Session) -> None:
Expand All @@ -24,3 +27,16 @@ def docs(session: Session) -> None:
session.run("sphinx-autobuild", *args)
else:
session.run("sphinx-build", *args)

@nox.session
def linkcheck(session: Session) -> None:
"""Build the documentation."""
args = session.posargs or ["-W", "-b", "linkcheck", "docs", "docs/_build"]

builddir = Path("docs", "_build")
if builddir.exists():
shutil.rmtree(builddir)

session.install("-r", "docs/requirements.txt")

session.run("sphinx-build", *args)