From 7f0d532ffb88a330fd5fda594da6d06fb9b7b713 Mon Sep 17 00:00:00 2001 From: Graham Knapp <32717635+dancergraham@users.noreply.github.com> Date: Sat, 28 Dec 2024 15:32:33 +0100 Subject: [PATCH] Test all pull requests for docs (#536) * WIP - Test the docs Related to #526 Add a command to build the documentation using Sphinx and update the CI workflow to include a documentation build stage. * **run.sh** - Add a command to build the documentation using Sphinx. - Update the usage function to include the new builddocs command. * **.github/workflows/python-package.yml** - Add a new stage to run the documentation building to ensure it works. - Update the release-production stage to depend on the new docs stage. * refactor: simplify changes * refactor: undo changes to run.sh --- .github/workflows/python-package.yml | 22 +++++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) diff --git a/.github/workflows/python-package.yml b/.github/workflows/python-package.yml index 604823a8..f3c15cd9 100644 --- a/.github/workflows/python-package.yml +++ b/.github/workflows/python-package.yml @@ -105,13 +105,33 @@ jobs: run: | tox -e i18n + docs: + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v4 + - uses: actions/setup-python@v5 + - uses: actions/cache@v4 + with: + path: ~/.cache/pip + key: ${{ matrix.python-version }}-pip-${{ hashFiles('**/requirements.txt') }} + restore-keys: | + ${{ matrix.python-version }}-pip- + - name: Install dependencies + run: | + python -m pip install --upgrade pip + python -m pip install sphinx + - name: Build docs + run: | + sphinx-build -b html docs docs/_build + release-production: # Only upload if a tag is pushed (otherwise just build & check) if: github.event_name == 'push' && startsWith(github.event.ref, 'refs/tags') runs-on: ubuntu-latest - needs: [test, lint, i18n] + needs: [test, lint, i18n, docs] steps: - uses: actions/checkout@v4