Merge pull request #1047 from sphinx-contrib/singlebuilder-to-use-wri… #1107
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
# Action which validates the ability to build this extension against multiple | |
# versions of Sphinx using various Python interpreters. | |
name: Build | |
on: | |
push: | |
branches: | |
- main | |
paths: | |
- '.github/workflows/build.yml' | |
- 'sphinxcontrib/**' | |
- 'tests/**' | |
- '.pylintrc' | |
- 'MANIFEST.in' | |
- 'pyproject.toml' | |
- 'requirements_dev.txt' | |
- 'ruff.toml' | |
- 'tox.ini' | |
pull_request: | |
branches: | |
- main | |
paths: | |
- '.github/workflows/build.yml' | |
- 'sphinxcontrib/**' | |
- 'tests/**' | |
- '.pylintrc' | |
- 'MANIFEST.in' | |
- 'pyproject.toml' | |
- 'requirements_dev.txt' | |
- 'ruff.toml' | |
- 'tox.ini' | |
jobs: | |
build: | |
name: ${{ matrix.toxenv }} (${{ matrix.os }}) | |
runs-on: ${{ matrix.os }} | |
strategy: | |
matrix: | |
include: | |
# test each python/sphinx pair supported | |
- { os: ubuntu-latest, python: "3.9", toxenv: py39-sphinx72, cache: ~/.cache/pip } | |
- { os: ubuntu-latest, python: "3.9", toxenv: py39-sphinx73, cache: ~/.cache/pip } | |
- { os: ubuntu-latest, python: "3.9", toxenv: py39-sphinx74, cache: ~/.cache/pip } | |
- { os: ubuntu-latest, python: "3.10", toxenv: py310-sphinx72, cache: ~/.cache/pip } | |
- { os: ubuntu-latest, python: "3.10", toxenv: py310-sphinx73, cache: ~/.cache/pip } | |
- { os: ubuntu-latest, python: "3.10", toxenv: py310-sphinx74, cache: ~/.cache/pip } | |
- { os: ubuntu-latest, python: "3.10", toxenv: py310-sphinx80, cache: ~/.cache/pip } | |
- { os: ubuntu-latest, python: "3.10", toxenv: py310-sphinx81, cache: ~/.cache/pip } | |
- { os: ubuntu-latest, python: "3.11", toxenv: py311-sphinx72, cache: ~/.cache/pip } | |
- { os: ubuntu-latest, python: "3.11", toxenv: py311-sphinx73, cache: ~/.cache/pip } | |
- { os: ubuntu-latest, python: "3.11", toxenv: py311-sphinx74, cache: ~/.cache/pip } | |
- { os: ubuntu-latest, python: "3.11", toxenv: py311-sphinx80, cache: ~/.cache/pip } | |
- { os: ubuntu-latest, python: "3.11", toxenv: py311-sphinx81, cache: ~/.cache/pip } | |
- { os: ubuntu-latest, python: "3.12", toxenv: py312-sphinx72, cache: ~/.cache/pip } | |
- { os: ubuntu-latest, python: "3.12", toxenv: py312-sphinx73, cache: ~/.cache/pip } | |
- { os: ubuntu-latest, python: "3.12", toxenv: py312-sphinx74, cache: ~/.cache/pip } | |
- { os: ubuntu-latest, python: "3.12", toxenv: py312-sphinx80, cache: ~/.cache/pip } | |
- { os: ubuntu-latest, python: "3.12", toxenv: py312-sphinx81, cache: ~/.cache/pip } | |
# other OSes | |
# - test against all other supported OSes, using most recent interpreter/sphinx | |
- { os: macos-latest, python: "3.12", toxenv: py312-sphinx81, cache: ~/Library/Caches/pip } | |
- { os: windows-latest, python: "3.12", toxenv: py312-sphinx81, cache: ~\AppData\Local\pip\Cache } | |
# linting/other | |
# - any OS, using most recent interpreter | |
- { os: ubuntu-latest, python: "3.12", toxenv: ruff, cache: ~/.cache/pip } | |
- { os: ubuntu-latest, python: "3.12", toxenv: pylint, cache: ~/.cache/pip } | |
- { os: ubuntu-latest, python: "3.12", toxenv: mypy, cache: ~/.cache/pip } | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up Python ${{ matrix.python }} | |
uses: actions/setup-python@v5 | |
with: | |
python-version: ${{ matrix.python }} | |
- name: Cache pip | |
uses: actions/cache@v4 | |
id: cache-pip | |
with: | |
path: ${{ matrix.cache }} | |
key: ${{ matrix.os }}-${{ matrix.python }}-pip-${{ matrix.toxenv }} | |
- name: Install dependencies | |
run: python -m pip install --upgrade tox | |
- name: tox | |
env: | |
TOXENV: ${{ matrix.toxenv }} | |
run: tox |