|
| 1 | +name: CI |
| 2 | + |
| 3 | +on: |
| 4 | + push: |
| 5 | + pull_request: |
| 6 | + |
| 7 | +jobs: |
| 8 | + tests: |
| 9 | + name: ${{ matrix.platform }}/${{ matrix.python }} tests |
| 10 | + runs-on: ${{ matrix.platform }}-latest |
| 11 | + timeout-minutes: 5 |
| 12 | + strategy: |
| 13 | + fail-fast: false |
| 14 | + matrix: |
| 15 | + python: ["3.9", "3.10", "3.11", "3.12", "3.13", "pypy-3.10"] |
| 16 | + platform: ["windows", "ubuntu", "macos"] |
| 17 | + |
| 18 | + steps: |
| 19 | + - uses: actions/checkout@v3 |
| 20 | + - uses: actions/setup-python@v5 |
| 21 | + with: |
| 22 | + python-version: ${{ matrix.python }} |
| 23 | + allow-prereleases: true |
| 24 | + |
| 25 | + - run: pip install uv nox |
| 26 | + - run: nox -s test |
| 27 | + # TODO: combine coverage |
| 28 | + |
| 29 | + - name: upload coverage |
| 30 | + if: always() |
| 31 | + uses: actions/upload-artifact@v4 |
| 32 | + with: |
| 33 | + name: coverage-data-${{ matrix.platform }}-${{ matrix.python }} |
| 34 | + path: .coverage.* |
| 35 | + include-hidden-files: true |
| 36 | + if-no-files-found: ignore |
| 37 | + |
| 38 | + coverage: |
| 39 | + name: combine and check coverage |
| 40 | + if: always() |
| 41 | + needs: tests |
| 42 | + runs-on: ubuntu-latest |
| 43 | + |
| 44 | + steps: |
| 45 | + - uses: actions/checkout@v3 |
| 46 | + - uses: actions/setup-python@v5 |
| 47 | + with: |
| 48 | + python-version: "3.13" |
| 49 | + - uses: actions/download-artifact@v4 |
| 50 | + with: |
| 51 | + pattern: coverage-data-* |
| 52 | + merge-multiple: true |
| 53 | + |
| 54 | + - run: | |
| 55 | + pip install -r test-requirements.txt |
| 56 | + coverage combine |
| 57 | +
|
| 58 | + coverage report --format=markdown >> $GITHUB_STEP_SUMMARY |
| 59 | + coverage report --fail-under=0 |
| 60 | +
|
| 61 | + lint: |
| 62 | + name: lint |
| 63 | + runs-on: ubuntu-latest |
| 64 | + timeout-minutes: 5 |
| 65 | + |
| 66 | + steps: |
| 67 | + - uses: actions/checkout@v3 |
| 68 | + - uses: actions/setup-python@v5 |
| 69 | + with: |
| 70 | + python-version: 3.13 |
| 71 | + |
| 72 | + - uses: pre-commit/[email protected] |
| 73 | + - uses: pre-commit-ci/[email protected] |
| 74 | + if: always() |
0 commit comments