diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml new file mode 100644 index 0000000..d7665f7 --- /dev/null +++ b/.github/workflows/docs.yml @@ -0,0 +1,50 @@ +name: 'docs' + +# Builds the documentation with warnings as errors, as Read the Docs does, and keeps the HTML +# as an artifact. A push to main triggers the Read the Docs build of latest, which publishes +# it, see .readthedocs.yaml. + +on: + push: + pull_request: + workflow_dispatch: + +jobs: + + docs: + runs-on: ubuntu-24.04 + name: '📚 Sphinx' + steps: + + - name: '🧰 Checkout' + uses: actions/checkout@v4 + + - name: '🐍 Setup Python' + uses: actions/setup-python@v6 + with: + python-version: '3.13' + + - name: '📚 Build' + run: | + pip install -r docs/requirements.txt + sphinx-build -W --keep-going -b html docs docs/_build/html + + - name: '📤 Upload HTML' + uses: actions/upload-artifact@v4 + with: + name: docs-html + path: docs/_build/html + + publish: + needs: docs + if: github.event_name == 'push' && github.ref == 'refs/heads/main' && github.repository == 'VUnit/vunit-python-bridge' + runs-on: ubuntu-24.04 + name: '🚀 Read the Docs' + steps: + + - name: '🚀 Trigger the build of latest' + env: + READTHEDOCS_TOKEN: ${{ secrets.READTHEDOCS_TOKEN }} + run: | + curl --fail-with-body -X POST -H "Authorization: Token $READTHEDOCS_TOKEN" \ + https://readthedocs.org/api/v3/projects/vunit-python-bridge/versions/latest/builds/ diff --git a/.readthedocs.yaml b/.readthedocs.yaml new file mode 100644 index 0000000..1764ff1 --- /dev/null +++ b/.readthedocs.yaml @@ -0,0 +1,16 @@ +# Read the Docs builds the documentation on every push, with the same Sphinx as the docs +# workflow in .github/workflows/docs.yml. +version: 2 + +build: + os: ubuntu-24.04 + tools: + python: "3.13" + +sphinx: + configuration: docs/conf.py + fail_on_warning: true + +python: + install: + - requirements: docs/requirements.txt diff --git a/docs/requirements.txt b/docs/requirements.txt new file mode 100644 index 0000000..770fd46 --- /dev/null +++ b/docs/requirements.txt @@ -0,0 +1,2 @@ +# Pinned so that a new Sphinx release doesn't break the -W build. +sphinx==9.1.0