|
| 1 | +name: CI |
| 2 | + |
| 3 | +on: |
| 4 | + push: |
| 5 | + branches: [develop, master, main] |
| 6 | + pull_request: |
| 7 | + workflow_dispatch: |
| 8 | + |
| 9 | +concurrency: |
| 10 | + group: ${{ github.workflow }}-${{ github.ref }} |
| 11 | + cancel-in-progress: true |
| 12 | + |
| 13 | +jobs: |
| 14 | + test: |
| 15 | + runs-on: ubuntu-latest |
| 16 | + strategy: |
| 17 | + fail-fast: false |
| 18 | + matrix: |
| 19 | + python-version: |
| 20 | + ['3.10', '3.11', '3.12', '3.13', '3.14', 'pypy3.10', 'pypy3.11'] |
| 21 | + steps: |
| 22 | + - uses: actions/checkout@v4 |
| 23 | + - uses: astral-sh/setup-uv@v6 |
| 24 | + with: |
| 25 | + python-version: ${{ matrix.python-version }} |
| 26 | + enable-cache: true |
| 27 | + # tox-gh-actions maps the running interpreter to the matching env via the |
| 28 | + # [gh-actions] table in tox.ini (PyPy keyed as `pypy-3.10` / `pypy-3.11`). |
| 29 | + # COVERAGE_FILE gives each cell a unique data file for the combine job. |
| 30 | + - run: uvx --with tox-uv --with tox-gh-actions tox |
| 31 | + env: |
| 32 | + COVERAGE_FILE: .coverage.${{ matrix.python-version }} |
| 33 | + - uses: actions/upload-artifact@v4 |
| 34 | + with: |
| 35 | + name: coverage-${{ matrix.python-version }} |
| 36 | + path: .coverage.* |
| 37 | + include-hidden-files: true |
| 38 | + if-no-files-found: error |
| 39 | + |
| 40 | + lint: |
| 41 | + runs-on: ubuntu-latest |
| 42 | + steps: |
| 43 | + - uses: actions/checkout@v4 |
| 44 | + - uses: astral-sh/setup-uv@v6 |
| 45 | + - run: uvx --with tox-uv tox -e lint |
| 46 | + |
| 47 | + type-check: |
| 48 | + runs-on: ubuntu-latest |
| 49 | + strategy: |
| 50 | + fail-fast: false |
| 51 | + matrix: |
| 52 | + checker: [mypy, pyright, pyrefly] |
| 53 | + steps: |
| 54 | + - uses: actions/checkout@v4 |
| 55 | + - uses: astral-sh/setup-uv@v6 |
| 56 | + - run: uvx --with tox-uv tox -e ${{ matrix.checker }} |
| 57 | + |
| 58 | + codespell: |
| 59 | + runs-on: ubuntu-latest |
| 60 | + steps: |
| 61 | + - uses: actions/checkout@v4 |
| 62 | + - uses: astral-sh/setup-uv@v6 |
| 63 | + - run: uvx --with tox-uv tox -e codespell |
| 64 | + |
| 65 | + docs: |
| 66 | + runs-on: ubuntu-latest |
| 67 | + steps: |
| 68 | + - uses: actions/checkout@v4 |
| 69 | + - uses: astral-sh/setup-uv@v6 |
| 70 | + - run: uvx --with tox-uv tox -e docs |
| 71 | + |
| 72 | + coverage: |
| 73 | + needs: test |
| 74 | + runs-on: ubuntu-latest |
| 75 | + steps: |
| 76 | + - uses: actions/checkout@v4 |
| 77 | + - uses: astral-sh/setup-uv@v6 |
| 78 | + - uses: actions/download-artifact@v4 |
| 79 | + with: |
| 80 | + pattern: coverage-* |
| 81 | + merge-multiple: true |
| 82 | + - run: uv run coverage combine |
| 83 | + - run: uv run coverage report --show-missing --fail-under=100 |
0 commit comments