Upgrade pytest #190
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: 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"] | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
- name: Set up Python ${{ matrix.python-version }} | |
id: setup-python | |
uses: actions/setup-python@v5 | |
with: | |
python-version: ${{ matrix.python-version }} | |
- name: Cache Poetry install | |
uses: actions/cache@v4 | |
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 | |
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@v4 | |
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 |