Revisit GitHub Actions #23
This file contains hidden or 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
| # Runs on every push / pull-request against master. | |
| # Matrix: Python 3.11 – 3.14 | type-check (mypy) + tests (pytest) + coverage | |
| name: Python Client - CI | |
| on: | |
| push: | |
| branches: [master] | |
| pull_request: | |
| branches: [master] | |
| # Restrict the default GITHUB_TOKEN to read-only. | |
| # Individual jobs add back only the permissions they need. | |
| permissions: | |
| contents: read | |
| jobs: | |
| test: | |
| name: "Test · Python ${{ matrix.python-version }}" | |
| runs-on: ubuntu-latest | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| python-version: ["3.11", "3.12", "3.13", "3.14"] | |
| 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.14' | |
| 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.14" | |
| 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/* |