Skip to content

Cleanup, testing, and hardening #107

Cleanup, testing, and hardening

Cleanup, testing, and hardening #107

Workflow file for this run

name: Build Documentation
on:
push:
pull_request:
permissions:
contents: read
env:
PYTHONNOUSERSITE: "1"
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
build_docs:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.12"]
fail-fast: false
defaults:
run:
shell: bash -l {0}
steps:
- name: Set env vars
run: |
export REPOSITORY_NAME=${GITHUB_REPOSITORY#*/} # just the repo, as opposed to org/repo
echo "REPOSITORY_NAME=${REPOSITORY_NAME}" >> $GITHUB_ENV
- name: Checkout the code
uses: actions/checkout@v5
with:
fetch-depth: 1000 # should be enough to reach the most recent tag
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v6
with:
python-version: ${{ matrix.python-version }}
- name: Install documentation-building requirements
run: |
# For reference: https://www.gnu.org/software/bash/manual/html_node/The-Set-Builtin.html.
set -vxeuo pipefail
# These packages are installed in the base environment but may be older
# versions. Explicitly upgrade them because they often create
# installation problems if out of date.
python -m pip install --upgrade pip setuptools numpy
python -m pip install ".[docs]"
python -m pip list
- name: Build Docs
run: PYCHX_DOCS_OFFLINE=1 make -C docs/ SPHINXOPTS="-W --keep-going" html
- uses: actions/upload-artifact@v4
with:
name: ${{ env.REPOSITORY_NAME }}-docs
path: docs/build/html/