Skip to content

ci(coverage.yml): add GitHub Actions workflow for running tests and c… #2

ci(coverage.yml): add GitHub Actions workflow for running tests and c…

ci(coverage.yml): add GitHub Actions workflow for running tests and c… #2

Workflow file for this run

name: Run tests
on:
push:
branches:
- master
jobs:
tests:
strategy:
fail-fast: false
matrix:
python-version: ["3.10", "3.11", "3.12"]
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: Install Poetry
uses: abatilo/actions-poetry@v2
- name: Setup a local virtual environment
run: |
poetry config virtualenvs.create true --local
poetry config virtualenvs.in-project true --local
- uses: actions/cache@v3
name: Define a cache for the virtual environment based on the dependencies lock file
with:
path: ./.venv
key: venv-${{ hashFiles('poetry.lock') }}
- name: Install dependencies
run: poetry install
- name: Run tests
run: poetry run pytest