Use Poetry for dependency management, loosen dependency restrictions, drop python 3.8 support #121
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: 'π Python Tests' | |
on: | |
pull_request: | |
branches: | |
- main | |
concurrency: | |
group: ci-tests-${{ github.ref }}-pytest | |
cancel-in-progress: true | |
jobs: | |
python-tests: | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
python-version: [ "3.9", "3.12" ] | |
steps: | |
- name: Checkout repo | |
uses: actions/checkout@v4 | |
- id: setup_python | |
name: Set up Python ${{ matrix.python-version }} Environment | |
uses: actions/setup-python@v4 | |
with: | |
python-version: ${{ matrix.python-version }} | |
- id: python_cache | |
name: Retrieve Cached Python Dependencies | |
uses: actions/cache@v4 | |
with: | |
path: ${{ env.pythonLocation }} | |
key: ${{ runner.os }}-pip-${{ steps.setup_python.outputs.python-version }}-${{ hashFiles('dev-requirements.txt', 'requirements.txt') }} | |
- name: Upgrade pip | |
if: steps.python_cache.outputs.cache-hit != 'true' | |
run: python -m pip install --upgrade pip | |
- name: Install Dependencies | |
run: pip install . -r dev-requirements.txt | |
- name: Tests (Coverage) | |
if: matrix.python-version == '3.12' | |
run: | | |
pip install coverage | |
coverage run --data-file=data -m pytest tests | |
coverage xml -i --data-file=data -o coverage.xml | |
- name: Tests | |
if: matrix.python-version != '3.12' | |
run: pytest tests | |
- name: Upload to Codecov | |
if: matrix.python-version == '3.12' | |
uses: codecov/[email protected] | |
with: | |
token: ${{ secrets.CODECOV_TOKEN }} | |
files: coverage.xml | |
fail_ci_if_error: false | |
verbose: true |