From 914bc0fdd0583faf731213cc107140d42c1fa058 Mon Sep 17 00:00:00 2001 From: frostedoyster Date: Sat, 2 Dec 2023 12:24:54 +0100 Subject: [PATCH] Set up tox -e docs and run it in CI --- .github/workflows/docs.yml | 27 +++++++++++++++++++++++++++ tox.ini | 9 +++++++++ 2 files changed, 36 insertions(+) create mode 100644 .github/workflows/docs.yml diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml new file mode 100644 index 000000000..d0dfdefdb --- /dev/null +++ b/.github/workflows/docs.yml @@ -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 diff --git a/tox.ini b/tox.ini index a149d5770..b36676160 100644 --- a/tox.ini +++ b/tox.ini @@ -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