|
1 | | -name: test |
| 1 | +# This workflow runs pytest unit tests and code coverage reporting on push and pull requests to the main branch. |
| 2 | +# It tests against multiple Python versions and operating systemsto ensure compatibility. The workflow uses Codecov |
| 3 | +# for coverage reporting, and the results are uploaded to Codecov using a secret token. |
| 4 | +name: Test |
2 | 5 |
|
3 | 6 | on: |
4 | | - push: # any branch |
5 | | - pull_request: |
| 7 | + pull_request: # any branch |
| 8 | + types: [opened, synchronize, reopened] |
| 9 | + push: |
6 | 10 | branches: [main] |
7 | 11 |
|
8 | 12 | env: |
9 | 13 | FORCE_COLOR: 1 |
10 | 14 |
|
11 | 15 | jobs: |
12 | | - test-ubuntu: |
13 | | - runs-on: ubuntu-latest |
| 16 | + test: |
14 | 17 | strategy: |
15 | 18 | fail-fast: false |
16 | 19 | matrix: |
17 | | - python-version: |
18 | | - ["3.10", "3.11", "3.12", "3.13", "3.14", "3.14t"] |
19 | | - |
| 20 | + os: [ubuntu-latest, macos-latest, windows-latest] |
| 21 | + python-version: ["3.10", "3.11", "3.12", "3.13", "3.14", "3.14t", "3.15-dev"] |
| 22 | + runs-on: ${{ matrix.os }} |
20 | 23 | steps: |
21 | 24 | - uses: actions/checkout@v6.0.2 |
22 | 25 | - uses: astral-sh/setup-uv@v7 |
23 | 26 | with: |
24 | 27 | python-version: ${{ matrix.python-version }} |
25 | | - - name: Code formatting |
26 | | - if: ${{ matrix.python-version == '3.14' }} |
27 | | - run: | |
28 | | - uv run ruff check . |
29 | | - uv run ruff format --check . |
30 | | - - name: Typos |
31 | | - if: ${{ matrix.python-version == '3.14' }} |
32 | | - run: | |
33 | | - uv run typos . |
34 | 28 | - name: Unit test |
35 | 29 | run: | |
36 | 30 | uv run coverage run -m pytest tests/ |
37 | | - - name: Type Checking |
38 | | - run: | |
39 | | - uv run mypy --strict src/ --platform win32 |
40 | | - uv run mypy --strict src/ --platform linux |
41 | | - uv run mypy --strict src/ --platform darwin |
42 | 31 | - name: Run codecov |
43 | 32 | run: | |
44 | 33 | uv run codecov |
45 | 34 | - name: Upload coverage to Codecov |
46 | | - uses: codecov/codecov-action@v5 |
| 35 | + uses: codecov/codecov-action@v6 |
47 | 36 | env: |
48 | 37 | CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} |
0 commit comments