Skip to content

Add Python 3.12 to the build matrix #176

Add Python 3.12 to the build matrix

Add Python 3.12 to the build matrix #176

Workflow file for this run

name: Run tests
on: [push]
jobs:
build:
runs-on: ubuntu-22.04
strategy:
fail-fast: false
matrix:
python-version: ["3.8", "3.9", "3.10", "3.11", "3.12-dev"]
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Set up Python ${{ matrix.python-version }}
id: setup-python
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: Cache Poetry install
uses: actions/cache@v3
with:
path: ~/.local
# NB! Update key when Poetry version is updated
key: python-${{ steps.setup-python.outputs.python-version }}-poetry-1.2.2
- name: Install Poetry
uses: snok/install-poetry@v1.3.3
with:
# NB! Update Poetry cache key when updating Poetry version
version: 1.2.2
virtualenvs-create: true
virtualenvs-in-project: true
- name: Load cached venv
id: cached-poetry-dependencies
uses: actions/cache@v3
with:
path: .venv
key: venv-${{ steps.setup-python.outputs.python-version }}-${{ hashFiles('**/poetry.lock') }}
- name: Install dependencies
run: poetry install --all-extras --no-interaction --no-root
if: steps.cached-poetry-dependencies.outputs.cache-hit != 'true'
- name: Install library
run: poetry install --all-extras --no-interaction
- name: Test with pytest
run: poetry run pytest