Skip to content

Revisit GitHub Actions #20

Revisit GitHub Actions

Revisit GitHub Actions #20

# Runs on every push / pull-request against master.
# Matrix: Python 3.10 – 3.13 | type-check (mypy) + tests (pytest) + coverage
name: Python Client - CI
on:
push:
branches: [master]
pull_request:
branches: [master]
jobs:
test:
name: "Test · Python ${{ matrix.python-version }}"
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
python-version: ["3.10", "3.11", "3.12", "3.13"]
steps:
- uses: actions/checkout@v4
- name: "Set up Python ${{ matrix.python-version }}"
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
cache: pip
- name: Install dependencies
run: pip install -e ".[dev]"
- name: Type-check (mypy)
run: mypy
- name: Test with pytest
run: pytest --cov-report=xml
- name: Upload coverage to Codecov
if: matrix.python-version == '3.13'
uses: codecov/codecov-action@v4
with:
token: ${{ secrets.CODECOV_TOKEN }}
files: coverage.xml
fail_ci_if_error: false
build:
name: "Verify build"
runs-on: ubuntu-latest
needs: test
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: "3.13"
cache: pip
- name: Install build tools
run: pip install build twine
- name: Build distribution
run: python -m build
- name: Check distribution metadata
run: twine check dist/*