Skip to content

Use tomli library for Python < 3.11 (#91) #48

Use tomli library for Python < 3.11 (#91)

Use tomli library for Python < 3.11 (#91) #48

Workflow file for this run

name: Tests
on:
push:
branches:
- main
pull_request:
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
env:
POETRY_VERSION: 1.5.1
jobs:
testing:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"]
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: Load cached Poetry installation
id: poetry
uses: actions/cache@v3
with:
path: ~/.local
key: poetry-install-${{env.POETRY_VERSION}}-${{ runner.os }}-${{ matrix.python-version }}
- name: Install and configure Poetry
uses: snok/install-poetry@v1
if: steps.poetry.outputs.cache-hit != 'true'
with:
version: ${{env.POETRY_VERSION}}
virtualenvs-create: true
virtualenvs-in-project: false
- name: Cache Poetry cache
uses: actions/cache@v3
id: cache
with:
path: ~/.cache/pypoetry
key: poetry-cache-${{env.POETRY_VERSION}}-${{ runner.os }}-${{ matrix.python-version }}-${{ hashFiles('**/pyproject.toml') }}
- name: Install dependencies
if: steps.cache.outputs.cache-hit != 'true'
run: poetry install -v --all-extras
- name: Run pytest
run: poetry run pytest --cov=./ --cov-report=xml
- name: Coverage report
uses: codecov/codecov-action@v1