-
Notifications
You must be signed in to change notification settings - Fork 2
51 lines (43 loc) · 1.55 KB
/
tests.yaml
File metadata and controls
51 lines (43 loc) · 1.55 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
name: Tests
on: [ push, pull_request, workflow_dispatch ]
permissions: {}
concurrency:
group: tests-${{ github.ref }}
cancel-in-progress: true
jobs:
pytest:
runs-on: ubuntu-latest
permissions:
contents: read
strategy:
fail-fast: false
matrix:
python-version: [ "3.12", "3.13", "3.14" ]
name: pytest (Python ${{ matrix.python-version }})
steps:
- name: Checkout
uses: actions/checkout@v5
- name: Install uv
uses: astral-sh/setup-uv@v6
- name: Install Python ${{ matrix.python-version }}
run: uv python install ${{ matrix.python-version }}
- name: Install dependencies
run: uv sync --all-extras --python ${{ matrix.python-version }}
# Network-dependent tests need a live OSH server (e.g. localhost:8282).
# They're tagged `@pytest.mark.network` and skipped here. The plan is
# to shim those with mocks; once a test no longer needs a real server,
# drop the marker and it will run in CI automatically.
- name: Run pytest with coverage
run: |
uv run --python ${{ matrix.python-version }} pytest -v \
-m "not network" \
--cov --cov-report=term --cov-report=xml
# Keep coverage.xml around so a later badge/Codecov upload step can use it.
- name: Upload coverage report artifact
if: always()
uses: actions/upload-artifact@v4
with:
name: coverage-${{ matrix.python-version }}
path: coverage.xml
if-no-files-found: warn
retention-days: 7