Skip to content

Refactor project to use Poetry as build backend, Pytest and Tox as te… #17

Refactor project to use Poetry as build backend, Pytest and Tox as te…

Refactor project to use Poetry as build backend, Pytest and Tox as te… #17

Workflow file for this run

name: Run unit tests
on: [push, pull_request]
jobs:
run_tests:
name: Run unit tests for Python ${{ matrix.python-version }}
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
python-version:
- "3.9"
- "3.10"
- "3.11"
- "3.12"
steps:
- name: Checkout repo
uses: actions/checkout@v4
id: checkout-repo
with:
fetch-depth: 0
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Install Poetry
uses: snok/install-poetry@v1
with:
virtualenvs-create: true
virtualenvs-in-project: true
installer-parallel: true
- name: Caches
id: cached-poetry-dependencies
uses: actions/cache@v4
with:
path: .venv
key: venv-${{ runner.os }}-${{ steps.setup-python.outputs.python-version }}-${{ hashFiles('**/poetry.lock') }}
- name: Install non-cached dependencies
if: steps.cached-poetry-dependencies.outputs.cache-hit != 'true'
run: poetry install --no-interaction --no-ansi
- name: Tox tests
run: tox -v