Skip to content

Commit

Permalink
add doc workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
jlaehne committed Dec 21, 2023
1 parent 1274e03 commit 7496dd2
Show file tree
Hide file tree
Showing 3 changed files with 57 additions and 3 deletions.
54 changes: 54 additions & 0 deletions .github/workflows/doc.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
name: Documentation

on: [push, pull_request]

jobs:
build:
name: Build documentation

jobs:
build:
# This build is to make PR comments for the sphinx warning and check if
# web links are not broken
name: Documentation: Check links and make PR comments
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0

- uses: actions/setup-python@v5
name: Install Python
with:
python-version: '3.11'

- name: Install build docs
shell: bash -l {0}
run: |
pip install .[doc]
# - name: Run doctest
# shell: bash -l {0}
# run: |
# cd ./doc
# pytest --doctest-modules --doctest-glob="*.rst" -n 2 -v

# Add sphinx warnings as PR comments
- uses: sphinx-doc/sphinx-problem-matcher@master

- name: Build documentation
shell: bash -l {0}
run: |
cd ./doc
make SPHINXOPTS="-W --keep-going" html
- uses: actions/upload-artifact@v4
with:
path: ./doc/_build/html/
name: doc_html

- name: Check links
shell: bash -l {0}
run: |
cd ./doc
make linkcheck
2 changes: 1 addition & 1 deletion doc/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
"sphinx.ext.mathjax",
"sphinx.ext.graphviz",
"sphinx.ext.autosummary",
"sphinx_toggleprompt",
"sphinx_copybutton",
]

intersphinx_mapping = {
Expand Down
4 changes: 2 additions & 2 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,10 +60,10 @@
extras_require={
"tests": ["pytest>=5.0"],
"coverage": ["pytest-cov", "codecov"],
"build-doc": [
"doc": [
"sphinx>=4.3.0",
"sphinx_rtd_theme>=0.5.1",
"sphinx-toggleprompt",
"sphinx-copybutton",
],
},
package_data={
Expand Down

0 comments on commit 7496dd2

Please sign in to comment.