Documentation tests #1676
Workflow file for this run
This file contains 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 Documentation Tests | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/setup-python@v5 | |
with: | |
python-version: '3.x' | |
cache: 'pip' | |
- name: Set PIPX_HOME | |
run: echo "PIPX_HOME=${{ runner.home }}/.pipx" >> $GITHUB_ENV | |
- name: Cache pipx environments | |
uses: actions/cache@v3 | |
with: | |
path: ${{ runner.home }}/.pipx | |
# pipx is creating a cachedir.tag with unique | |
key: ${{ runner.os }}-pipx-${{ hashFiles('.pipx/.cache/CACHEDIR.TAG') }} | |
restore-keys: | | |
${{ runner.os }}-pipx- | |
- name: Make sure latest hatch is installed | |
run: pipx upgrade hatch || pipx install hatch | |
- name: Cache Hatch environments | |
uses: actions/cache@v3 | |
with: | |
path: .hatch_envs | |
# hatch envs are described in pyproject.toml | |
key: ${{ runner.os }}-hatch-envs-${{ hashFiles('pyproject.toml') }} | |
restore-keys: | | |
${{ runner.os }}-hatch-envs- | |
- name: Set HATCH_ENV_TYPE_VIRTUAL_PATH | |
run: echo "HATCH_ENV_TYPE_VIRTUAL_PATH=$(pwd)/.hatch_envs" >> $GITHUB_ENV | |
- name: Run sphinx html builder | |
# -W = warnings as error | |
run: hatch run docs:html -W | |
- name: Run sphinx linkcheck | |
run: hatch run docs:linkcheck |