Add support for Python 3.12, drop support for Python 3.8 #187
Workflow file for this run
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: Tests | |
on: | |
push: | |
branches: | |
- master | |
pull_request: | |
# Run on manual triggers | |
workflow_dispatch: | |
jobs: | |
tests: | |
name: tests-python${{ matrix.python-version }}-${{ matrix.os }} | |
runs-on: ${{ matrix.os }} | |
strategy: | |
matrix: | |
python-version: ['3.9', '3.10', '3.11', '3.12'] | |
poetry-version: [1.7.1] | |
os: ["ubuntu-latest"] | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Install poetry | |
uses: abatilo/actions-poetry@v2 | |
with: | |
poetry-version: ${{ matrix.poetry-version }} | |
- name: Set up Python ${{ matrix.python-version }} | |
uses: actions/setup-python@v4 | |
with: | |
python-version: ${{ matrix.python-version }} | |
cache: "poetry" | |
- name: Check shell scripts | |
uses: ludeeus/action-shellcheck@2.0.0 | |
- name: Check Poetry lock file status | |
run: poetry lock --check | |
- name: Install coverage tool | |
run: | | |
poetry run pip install coverage[toml] | |
- name: Install examples dependencies (Python >= 3.11) | |
run: | | |
poetry install --only main --extras examples | |
# tweedledum has no wheel for Python >= 3.11 and the build errors | |
if: matrix.python-version >= '3.11' | |
- name: Install examples dependencies (Python < 3.11) | |
run: | | |
poetry install --only main --all-extras | |
if: matrix.python-version < '3.11' | |
- name: Run examples | |
run: | | |
poetry run examples/run_all.sh -c | |
- name: Install all dependencies | |
run: poetry install --sync | |
- name: Check version numbers consistency | |
run: poetry run poe version_check | |
- name: Check formatting | |
run: poetry run poe format_check | |
- name: Linting | |
run: poetry run poe lint | |
- name: Type checking | |
run: poetry run poe typecheck | |
- name: Testing | |
run: poetry run poe test --cov_opts="-a" # add to examples coverage | |
- name: Docs | |
run: poetry run poe docs | |
- name: Generate coverage report | |
run: poetry run coverage lcov -o coverage.lcov | |
- name: Upload coverage report | |
uses: coverallsapp/github-action@v2 | |
with: | |
file: coverage.lcov | |
parallel: true | |
flag-name: run ${{ join(matrix.*, ' - ') }} | |
finish: | |
needs: tests | |
runs-on: ubuntu-latest | |
steps: | |
- name: Close parallel coverage build | |
uses: coverallsapp/github-action@v2 | |
with: | |
parallel-finished: true |