| 1 |
--- |
| 2 |
name: CI |
| 3 |
|
| 4 |
"on": |
| 5 |
push: |
| 6 |
branches: |
| 7 |
- main |
| 8 |
pull_request: |
| 9 |
merge_group: |
| 10 |
|
| 11 |
permissions: |
| 12 |
contents: read |
| 13 |
|
| 14 |
env: |
| 15 |
DEFAULT_PYTHON: "3.14" |
| 16 |
|
| 17 |
jobs: |
| 18 |
lint: |
| 19 |
name: Lint |
| 20 |
runs-on: ubuntu-latest |
| 21 |
|
| 22 |
steps: |
| 23 |
- &checkout |
| 24 |
name: Check out the repository |
| 25 |
uses: actions/checkout@v7 |
| 26 |
with: |
| 27 |
fetch-depth: 2 |
| 28 |
|
| 29 |
- &setup-python |
| 30 |
name: Set up Python ${{ env.DEFAULT_PYTHON }} |
| 31 |
uses: actions/setup-python@v7 |
| 32 |
with: |
| 33 |
python-version: ${{ env.DEFAULT_PYTHON }} |
| 34 |
check-latest: true |
| 35 |
|
| 36 |
- &setup-uv |
| 37 |
name: Install UV |
| 38 |
uses: astral-sh/setup-uv@v7 |
| 39 |
with: |
| 40 |
enable-cache: true |
| 41 |
version-file: "pyproject.toml" |
| 42 |
|
| 43 |
- name: Install dependencies |
| 44 |
run: uv sync --all-extras --frozen |
| 45 |
|
| 46 |
- name: Lint |
| 47 |
run: uv run --with tox-uv tox -e lint |
| 48 |
|
| 49 |
test: |
| 50 |
strategy: |
| 51 |
fail-fast: false |
| 52 |
matrix: |
| 53 |
python-version: ["3.10", "3.11", "3.12", "3.13", "3.14", "3.15"] |
| 54 |
os: [ubuntu-latest, macos-latest, windows-latest] |
| 55 |
compiled: [true, false] |
| 56 |
runs-on: ${{ matrix.os }} |
| 57 |
name: "Tests (Python: ${{ matrix.python-version }}, OS: ${{ matrix.os }}, Compiled: ${{ matrix.compiled }})" |
| 58 |
env: |
| 59 |
FORCE_COLOR: 1 |
| 60 |
|
| 61 |
steps: |
| 62 |
- *checkout |
| 63 |
|
| 64 |
- name: Set up Python ${{ matrix.python-version }} |
| 65 |
uses: actions/setup-python@v7 |
| 66 |
with: |
| 67 |
python-version: ${{ matrix.python-version }} |
| 68 |
allow-prereleases: true |
| 69 |
check-latest: true |
| 70 |
|
| 71 |
- *setup-uv |
| 72 |
|
| 73 |
- name: "Install dependencies (compiled: ${{ matrix.compiled }})" |
| 74 |
env: |
| 75 |
HATCH_BUILD_HOOK_ENABLE_MYPYC: ${{ matrix.compiled }} |
| 76 |
run: uv sync --all-extras --frozen |
| 77 |
|
| 78 |
- name: Run tests |
| 79 |
env: |
| 80 |
COVERAGE_FAIL_UNDER: ${{ matrix.compiled && '0' || '99' }} |
| 81 |
run: uv run --with tox-uv tox -e py,coverage_report-ci |
| 82 |
|
| 83 |
- name: Report Coverage |
| 84 |
uses: codecov/codecov-action@v7 |
| 85 |
|
| 86 |
|
| 87 |
integration: |
| 88 |
name: Integration tests |
| 89 |
runs-on: ubuntu-latest |
| 90 |
|
| 91 |
steps: |
| 92 |
- *checkout |
| 93 |
- *setup-python |
| 94 |
- *setup-uv |
| 95 |
|
| 96 |
- name: Install dependencies (compiled) |
| 97 |
env: |
| 98 |
HATCH_BUILD_HOOK_ENABLE_MYPYC: true |
| 99 |
run: uv sync --all-extras --frozen |
| 100 |
|
| 101 |
- name: Test integration |
| 102 |
run: ./scripts/test_integration.sh |