Skip to content

Commit

Permalink
Move sphinx-apidoc command to script and run in CI
Browse files Browse the repository at this point in the history
  • Loading branch information
victorlin committed Jul 8, 2024
1 parent 50768fe commit 3e7c3d8
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 7 deletions.
20 changes: 20 additions & 0 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -188,3 +188,23 @@ jobs:
with:
docs-directory: docs/
pip-install-target: .[dev]

check-docs:
runs-on: ubuntu-latest
steps:
- uses: actions/setup-python@v5

- uses: actions/checkout@v4

- run: pip install .[dev]

- run: ./devel/generate-developer-api-docs

- name: Check for changes
run: |
if [[ -n $(git status --porcelain) ]]; then
git add .
git diff --staged >&2
echo "There are changes to the developer API docs. Please regenerate, commit, and push the changes." >&2
exit 1
fi
9 changes: 9 additions & 0 deletions devel/generate-developer-api-docs
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
#!/bin/bash

sphinx-apidoc \
--force \
--module-first \
--separate \
--no-toc \
--output-dir docs/api/developer \
augur
8 changes: 1 addition & 7 deletions docs/contribute/DEV_DOCS.md
Original file line number Diff line number Diff line change
Expand Up @@ -337,13 +337,7 @@ To update the developer API documentation after adding or removing an augur subm
autogenerate a new API file as follows.

```bash
sphinx-apidoc \
--force \
--module-first \
--separate \
--no-toc \
--output-dir docs/api/developer \
augur
./devel/generate-developer-api-docs
```

To make doc rebuilds faster, Sphinx caches built documentation by default,
Expand Down

0 comments on commit 3e7c3d8

Please sign in to comment.