Replace Poetry version plugin #702
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: Tests & checks | |
on: | |
pull_request: | |
workflow_dispatch: # allow running manually from the Actions tab | |
# cancel previous runs on a new commit | |
concurrency: | |
group: ${{ github.head_ref }} | |
cancel-in-progress: true | |
jobs: | |
ci: | |
strategy: | |
fail-fast: true | |
matrix: | |
python-version: ["3.9", "3.10", "3.11", "3.12"] | |
os: [macos-latest, ubuntu-latest, windows-latest] | |
exclude: | |
- python-version: "3.9" | |
os: macos-latest | |
include: | |
- python-version: "3.9" | |
os: macos-13 | |
runs-on: ${{ matrix.os }} | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up Python | |
uses: actions/setup-python@v5 | |
with: | |
python-version: ${{ matrix.python-version }} | |
- name: Install poetry | |
run: pipx install poetry --python python${{ matrix.python-version }} | |
- name: Set up venv | |
run: | | |
poetry config virtualenvs.create true --local | |
poetry config virtualenvs.in-project true --local | |
- uses: actions/cache@v3 | |
name: Define a venv cache | |
with: | |
path: ./.venv | |
key: ${{ matrix.os }}-venv-${{ hashFiles('**/poetry.lock') }} | |
- name: Install the project dependencies | |
run: poetry sync --with test | |
- name: Check pre-commit | |
run: poetry run pre-commit run --all-files | |
- name: Validate pyproject.toml | |
run: poetry check | |
- name: Run tests with pytest | |
run: poetry run make test | |
ci-docs: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Set up Python | |
uses: actions/setup-python@v4 | |
with: | |
python-version: 3.9 | |
- name: Install Poetry | |
run: pipx install poetry --python python3.9 | |
- name: Install the project dependencies | |
run: poetry sync --with docs | |
- name: Install Pandoc | |
uses: r-lib/actions/setup-pandoc@v2 | |
- name: Build documentation | |
run: poetry run make doctest |