Merge pull request #83 from espdev/update-packaging #89
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: 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.9", "3.10", "3.11", "3.12" ] | |
poetry-version: [ "1.8.3" ] | |
steps: | |
- name: Checkout project | |
uses: actions/checkout@v4 | |
- name: Setup Python ${{ matrix.python-version }} | |
uses: actions/setup-python@v5 | |
with: | |
python-version: ${{ matrix.python-version }} | |
- name: Install Poetry ${{ matrix.poetry-version }} | |
uses: abatilo/actions-poetry@v3 | |
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@v4 | |
with: | |
path: ./.venv | |
key: venv-${{ hashFiles('poetry.lock') }} | |
- name: Install the project dependencies | |
run: poetry install | |
- name: Run static analysis and linters | |
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 make -C docs/ html |