Fix bugs in documentation build #5
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: Build docs | |
| on: | |
| pull_request: | |
| branches: | |
| - main | |
| paths: | |
| - "docs/**" | |
| - "+**/*.m" | |
| - ".github/workflows/build_docs.yml" | |
| push: | |
| branches: | |
| - main | |
| paths: | |
| - "docs/**" | |
| - "+**/*.m" | |
| - ".github/workflows/build_docs.yml" | |
| workflow_dispatch: | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.event_name }}-${{ github.ref }} | |
| cancel-in-progress: true | |
| jobs: | |
| build_docs: | |
| name: Build Sphinx docs | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v6 | |
| - name: Remove folders not needed for docs build | |
| run: rm -rf +tests tools tutorials # not part of published API docs; fewer .m files for autodoc to scan | |
| - name: Set up Python | |
| uses: actions/setup-python@v6 | |
| with: | |
| python-version: "3.10" | |
| - name: Install dependencies | |
| run: | | |
| python -m pip install -U pip | |
| pip install -r docs/requirements.txt | |
| - name: Apply RTD-equivalent pre-build customizations | |
| run: python docs/source/sphinx_extensions/copy_files.py | |
| - name: Build docs (fail on any warning) | |
| run: sphinx-build -b html -W --keep-going docs/source docs/build/html |