-
Notifications
You must be signed in to change notification settings - Fork 1
120 lines (97 loc) · 3.95 KB
/
ci.yml
File metadata and controls
120 lines (97 loc) · 3.95 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
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
# =============================================================================
# .github/workflows/ci.yml — Continuous Integration
# =============================================================================
# Pull requests to main: fast required gate (tests minus @pytest.mark.slow) + lint.
# The full suite (including slow tests) runs nightly on a schedule and on demand
# via workflow_dispatch. Dependencies are cached via setup-uv to avoid
# re-downloading torch & friends on every run.
# =============================================================================
name: CI
on:
pull_request:
branches: [main]
workflow_dispatch:
schedule:
# Nightly full suite at 03:17 UTC (off-peak; avoids the top-of-hour cron herd).
- cron: "17 3 * * *"
permissions: read-all
concurrency:
group: ci-${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
# Pin native BLAS/OpenMP thread pools to 1. pytest-xdist (-n auto) already runs
# one worker per core; without this each worker's numpy/scipy/torch pool spawns
# more threads and they thrash, which made the suite ~50x slower on CI.
env:
OMP_NUM_THREADS: "1"
OPENBLAS_NUM_THREADS: "1"
MKL_NUM_THREADS: "1"
NUMEXPR_NUM_THREADS: "1"
VECLIB_MAXIMUM_THREADS: "1"
jobs:
# ── Fast required gate: everything except @pytest.mark.slow ────────────────
test:
name: Tests (fast)
runs-on: ubuntu-latest
if: github.event_name != 'schedule'
permissions:
contents: read
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0
with:
python-version: "3.13"
- uses: astral-sh/setup-uv@08807647e7069bb48b6ef5acd8ec9567f424441b # v8.1.0
with:
enable-cache: true
cache-dependency-glob: |
uv.lock
pyproject.toml
- name: Install dependencies
run: uv sync --extra dev
- name: Run pytest (fast — excludes @pytest.mark.slow)
run: uv run pytest tests/ -m "not slow" -n auto --tb=short
# ── Full suite: nightly schedule + manual dispatch ─────────────────────────
test-full:
name: Tests (full suite)
runs-on: ubuntu-latest
if: github.event_name == 'schedule' || github.event_name == 'workflow_dispatch'
permissions:
contents: read
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0
with:
python-version: "3.13"
- uses: astral-sh/setup-uv@08807647e7069bb48b6ef5acd8ec9567f424441b # v8.1.0
with:
enable-cache: true
cache-dependency-glob: |
uv.lock
pyproject.toml
- name: Install dependencies
run: uv sync --extra dev
- name: Run pytest (full suite, including slow)
run: uv run pytest tests/ -v -n auto --tb=short
# ── Lint ───────────────────────────────────────────────────────────────────
lint:
name: Lint
runs-on: ubuntu-latest
if: github.event_name != 'schedule'
permissions:
contents: read
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0
with:
python-version: "3.13"
- uses: astral-sh/setup-uv@08807647e7069bb48b6ef5acd8ec9567f424441b # v8.1.0
with:
enable-cache: true
cache-dependency-glob: |
uv.lock
pyproject.toml
- name: Install dependencies
run: uv sync --extra dev
- name: Ruff
run: uv run ruff check src/ tests/
continue-on-error: true