-
Notifications
You must be signed in to change notification settings - Fork 147
84 lines (69 loc) · 2.03 KB
/
Copy pathci.yml
File metadata and controls
84 lines (69 loc) · 2.03 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
79
80
81
82
83
84
name: CI
on:
push:
branches: [main]
pull_request:
branches: [main]
permissions:
contents: read
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
test-detection:
name: Detection tests
runs-on: ubuntu-latest
defaults:
run:
working-directory: Detection
steps:
- uses: actions/checkout@v7
- name: Install uv
uses: astral-sh/setup-uv@v7
with:
version: "latest"
enable-cache: true
- name: Set up Python
run: uv python install 3.12
- name: Install dependencies
run: uv sync --extra dev
- name: Run tests
run: uv run pytest tests/ -q
test-sensor:
name: Sensor tests (py${{ matrix.python-version }})
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
python-version: ["3.9", "3.10", "3.11", "3.12", "3.13"]
defaults:
run:
working-directory: Sensor
steps:
- uses: actions/checkout@v7
- name: Install uv
uses: astral-sh/setup-uv@v7
with:
version: "latest"
enable-cache: true
- name: Set up Python
run: uv python install ${{ matrix.python-version }}
- name: Install dependencies
run: uv sync --extra dev --python ${{ matrix.python-version }}
- name: Run tests
run: uv run --python ${{ matrix.python-version }} pytest tests/ -q
- name: Build distributions
if: matrix.python-version == '3.12'
run: uv build
# Aggregate gate for the matrix above. Branch protection requires a check
# named exactly "Sensor tests" (the job's pre-matrix name); this reports it.
# `if: always()` matters: without it a failed leg would leave this job
# skipped, and skipped jobs satisfy required checks.
test-sensor-gate:
name: Sensor tests
runs-on: ubuntu-latest
needs: test-sensor
if: always()
steps:
- name: All Sensor matrix legs must pass
run: test "${{ needs.test-sensor.result }}" = "success"