Setup poetry for packaging and dependency management #391
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: Continuous Integration | |
on: | |
- push | |
- pull_request | |
- workflow_dispatch | |
jobs: | |
ci: | |
runs-on: ${{ matrix.os }} | |
if: "!contains(github.event.head_commit.message, '[ci skip]') && !contains(github.event.head_commit.message, '[skip ci]')" | |
strategy: | |
fail-fast: false | |
matrix: | |
python-version: | |
- "3.10" | |
- "3.11" | |
- "3.12" | |
- "3.13" | |
- "pypy-3.10" | |
os: [ubuntu-latest, macos-latest] | |
pytest: | |
- "pytest>=6.0.0,<7.0.0" | |
- "pytest>=7.0.0,<8.0.0" | |
- "pytest>=8.0.0,<9.0.0" | |
exclude: | |
- python-version: "pypy-3.9" | |
os: macos-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up Python ${{ matrix.python-version }} | |
uses: actions/setup-python@v5 | |
with: | |
python-version: ${{ matrix.python-version }} | |
- name: Get pip cache dir | |
id: pip-cache | |
run: | | |
echo "::set-output name=dir::$(pip cache dir)" | |
- name: pip cache | |
uses: actions/cache@v4 | |
with: | |
path: ${{ steps.pip-cache.outputs.dir }} | |
key: ${{ matrix.os }}-${{ matrix.python-version }}-v2-${{ hashFiles('**/setup.py') }} | |
restore-keys: | | |
${{ matrix.os }}-${{ matrix.python-version }}-v2- | |
- name: Install dependencies | |
run: | | |
python -m pip install -U pip poetry | |
python -m pip install "${{ matrix.pytest }}" | |
make install | |
- name: Test | |
shell: bash | |
run: | | |
make check test | |
- name: Upload coverage | |
uses: codecov/[email protected] | |
with: | |
name: ${{ matrix.os }} Python ${{ matrix.python-version }} ${{ matrix.pytest }} | |
token: ${{ secrets.CODECOV_TOKEN }} | |
- name: Upload test results to Codecov | |
if: ${{ !cancelled() }} | |
uses: codecov/test-results-action@v1 | |
with: | |
token: ${{ secrets.CODECOV_TOKEN }} |