-
Notifications
You must be signed in to change notification settings - Fork 0
78 lines (64 loc) · 2.25 KB
/
Copy pathtests.yml
File metadata and controls
78 lines (64 loc) · 2.25 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
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
name: Tests
on:
push:
branches: [main]
pull_request:
workflow_dispatch:
# Cancel superseded runs on the same ref (saves CI minutes on rapid pushes).
concurrency:
group: tests-${{ github.ref }}
cancel-in-progress: true
defaults:
run:
# The installable project lives in the hackrfpy/ subdirectory (the one with
# pyproject.toml + the pytest config + the `hardware` marker).
working-directory: hackrfpy
jobs:
test:
name: pytest (${{ matrix.os }}, py${{ matrix.python-version }})
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
# windows-latest is first because it is the platform this library
# targets; the cross-platform lifecycle stubs must pass there.
os: [windows-latest, ubuntu-latest, macos-latest]
python-version: ["3.11", "3.12", "3.13"]
steps:
- uses: actions/checkout@v4
- name: Install uv
uses: astral-sh/setup-uv@v5
with:
enable-cache: true
python-version: ${{ matrix.python-version }}
- name: Sync environment (numpy + dev group, editable install)
run: uv sync
- name: Run test suite (hardware tests deselected)
run: uv run pytest -m "not hardware" --cov=hackrfpy --cov-report=xml --cov-report=term-missing
- name: Upload coverage to Codecov
# Optional: only runs once linked at https://codecov.io. Tokenless for
# public repos. Safe to leave in before linking - it just no-ops/soft-fails.
if: matrix.os == 'ubuntu-latest' && matrix.python-version == '3.12'
uses: codecov/codecov-action@v5
with:
files: hackrfpy/coverage.xml
fail_ci_if_error: false
lint:
name: ruff + mypy
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install uv
uses: astral-sh/setup-uv@v5
with:
enable-cache: true
python-version: "3.12"
- name: Sync environment
run: uv sync
- name: Ruff lint
run: uv run ruff check .
- name: Mypy
# Blocking. The package ships a py.typed marker, which promises
# downstream type-checkers that these annotations are real; this gate is
# what keeps that promise true.
run: uv run mypy