Documentation tests #17
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: test-docs | |
| run-name: Documentation tests | |
| on: | |
| pull_request: | |
| push: | |
| branches: [main] | |
| permissions: | |
| contents: read | |
| jobs: | |
| doc-test: | |
| name: Sphinx Tests (${{ matrix.builder }}) | |
| runs-on: ubuntu-latest | |
| if: "!contains(github.event.pull_request.labels.*.name, 'ci | skip')" | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| builder: [ linkcheck, html, lint ] | |
| include: | |
| # Run default html builder with warnings as error | |
| - builder: html | |
| args: -W | |
| - builder: lint | |
| sphinx_builder: html | |
| steps: | |
| - uses: actions/checkout@v6 | |
| with: | |
| persist-credentials: false | |
| - uses: actions/setup-python@v6 | |
| with: | |
| python-version: 3.x | |
| - uses: astral-sh/setup-uv@v7 | |
| with: | |
| activate-environment: true | |
| - name: Install tmt[docs] | |
| run: uv sync --frozen --extra docs | |
| # TODO: Move this to its own extra/group | |
| - name: Install other test dependencies | |
| run: uv pip install sphinx-lint | |
| if: ${{ matrix.builder == 'lint' }} | |
| - name: Cache linkcheck results | |
| uses: actions/cache@v5 | |
| with: | |
| path: docs/_build/linkcheck_cache.json | |
| key: linkcheck | |
| if: ${{ matrix.builder == 'linkcheck' }} | |
| - name: Run sphinx builder ${{ matrix.sphinx_builder || matrix.builder }} | |
| run: sphinx-build -b ${{ matrix.sphinx_builder || matrix.builder }} ${{ matrix.args }} docs/ docs/_build | |
| # TODO: enable all checks | |
| # https://github.com/sphinx-contrib/sphinx-lint/issues/74 | |
| - name: Run Sphinx ReST linter | |
| run: sphinx-lint --ignore=docs/_build docs tmt tests | |
| if: ${{ matrix.builder == 'lint' }} |