Skip to content

Commit

Permalink
Set up tox -e docs and run it in CI
Browse files Browse the repository at this point in the history
  • Loading branch information
frostedoyster committed Dec 2, 2023
1 parent 0638701 commit 914bc0f
Show file tree
Hide file tree
Showing 2 changed files with 36 additions and 0 deletions.
27 changes: 27 additions & 0 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
name: Documentation

on:
push:
branches: [main]
tags: ["*"]
pull_request:
# Check all PR

jobs:
build:
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v3
- name: setup Python
uses: actions/setup-python@v4
with:
python-version: "3.10"
- name: install dependencies
run: |
python -m pip install tox
sudo apt install doxygen
- name: build documentation
run: tox -e docs
env:
# Use the CPU-only version of torch
PIP_EXTRA_INDEX_URL: https://download.pytorch.org/whl/cpu
9 changes: 9 additions & 0 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,15 @@ commands =
twine check dist/*.tar.gz dist/*.whl
check-manifest {toxinidir}

[testenv:docs]
# this environement builds the documentation with sphinx
deps =
-r docs/requirements.txt

commands =
python -m pip install .
sphinx-build {posargs:-E} -W -b html docs/src docs/build/html

[flake8]
# longer lines for compatibility with other linters
max_line_length = 88
Expand Down

0 comments on commit 914bc0f

Please sign in to comment.