Skip to content

Use Poetry for project management #70

Use Poetry for project management

Use Poetry for project management #70

Workflow file for this run

name: main
on:
push:
branches: [ master ]
pull_request:
branches: [ master ]
jobs:
tests:
runs-on: ${{ matrix.platform }}
strategy:
max-parallel: 8
matrix:
platform: [ "ubuntu-latest", "macos-latest", "windows-latest" ]
python-version: [ "3.8", "3.9", "3.10", "3.11", "3.12" ]
poetry-version: [ "1.7.1" ]
steps:
- name: Checkout project
uses: actions/checkout@v3
- name: Setup Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: Install poetry
uses: abatilo/actions-poetry@v2
with:
poetry-version: ${{ matrix.poetry-version }}
- name: Setup a local virtual environment
run: |
poetry config virtualenvs.create true --local
poetry config virtualenvs.in-project true --local
- name: Define a cache for the virtual environment based on the dependencies lock file
uses: actions/cache@v3
with:
path: ./.venv
key: venv-${{ hashFiles('poetry.lock') }}
- name: Install the project dependencies
run: poetry install
- name: Ruff static analysis
run: poetry run ruff check .
- name: Run tests
run: poetry run pytest -v --color=yes --cov=csaps --cov-report=term --cov-report=lcov:coverage.info
- name: Send coverage report to Coveralls
if: ${{ matrix.platform == 'ubuntu-latest' && matrix.python-version == '3.12' }}
uses: coverallsapp/github-action@v2
with:
format: lcov
file: coverage.info
- name: Build docs
if: ${{ matrix.platform == 'ubuntu-latest' && matrix.python-version == '3.12' }}
run: poetry run sphinx-build -b html docs/ docs/_build/html