re-structured CI to include pip installable version before running tests #244
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Docs | |
| on: | |
| push: | |
| branches: [ main ] | |
| pull_request: | |
| jobs: | |
| build-docs: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: actions/setup-python@v5 | |
| with: | |
| python-version: "3.11" | |
| - name: Install package and docs deps | |
| run: | | |
| python -m pip install -U pip | |
| pip install -e . | |
| pip install -r docs/requirements.txt | |
| # (Optional) quick debug if installs ever fail: | |
| - name: Debug deps | |
| run: | | |
| echo "=== docs/requirements.txt ===" | |
| cat docs/requirements.txt | |
| python -c "import pkgutil; print('has sphinx_rtd_theme?', pkgutil.find_loader('sphinx_rtd_theme') is not None)" | |
| - name: Build Sphinx HTML (clean + build) | |
| run: | | |
| cd docs/source | |
| rm -rf _build .doctrees .cache **/__pycache__ .ipynb_checkpoints .jupyter_cache generated | |
| sphinx-build -b html -E -a -d _build/doctrees . _build/html | |
| command -v open >/dev/null 2>&1 && open _build/html/index.html || true | |
| - name: Upload HTML as artifact | |
| if: always() | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: docs-html | |
| path: docs/source/_build/html |