Skip to content

Commit

Permalink
Build documentation via tox (#36)
Browse files Browse the repository at this point in the history
To build the documentation, run `tox -e doc`.

Build the documentation on GHA.
  • Loading branch information
dweindl authored Jan 13, 2025
1 parent cb484eb commit c9460f2
Show file tree
Hide file tree
Showing 14 changed files with 42 additions and 2 deletions.
28 changes: 28 additions & 0 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -115,3 +115,31 @@ jobs:
echo $! > ccompass_pid.txt
sleep 10
kill $(cat ccompass_pid.txt)
test_docs:
runs-on: ubuntu-latest

steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.12'

- name: Cache tox
uses: actions/cache@v4
with:
path: ~/.cache/tox
key: ${{ runner.os }}-tox-${{ hashFiles('pyproject.toml') }}
restore-keys: |
${{ runner.os }}-tox-
- name: Install dependencies
run: |
pip install tox
- name: Build documentation
run: |
tox -e doc
1 change: 1 addition & 0 deletions doc/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
_build
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion docs/conf.py → doc/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,4 +24,4 @@
# https://www.sphinx-doc.org/en/master/usage/configuration.html#options-for-html-output

html_theme = "alabaster"
html_static_path = ["_static"]
# html_static_path = ["_static"]
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
13 changes: 12 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -27,4 +27,15 @@ requires-python = ">=3.10"
ccompass = "ccompass.CCMPS:main"

[project.optional-dependencies]
dev = ["pre-commit>=3"]
dev = ["pre-commit>=3", "tox"]
doc = ["sphinx", "sphinx-rtd-theme"]

[tool.tox]
requires = ["tox>=4.19"]
env_list = ["doc"]

[tool.tox.env.doc]
description = "Build the documentation"
extras = ["doc"]
commands = [["sphinx-build", "-W", "-b", "html", "doc/", "doc/_build/html"]]
working_directory = "doc"

0 comments on commit c9460f2

Please sign in to comment.