-
Notifications
You must be signed in to change notification settings - Fork 145
146 lines (137 loc) · 4.55 KB
/
Copy pathtest.yml
File metadata and controls
146 lines (137 loc) · 4.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
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
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
name: CI
on:
push:
branches:
- master
pull_request:
types: [opened, synchronize, reopened, ready_for_review]
permissions:
# Restrict the default GITHUB_TOKEN to read-only repository access.
contents: read
concurrency:
# Cancel older runs for the same PR/branch when new commits arrive.
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
jobs:
quality:
name: Quality checks
runs-on: ubuntu-latest
timeout-minutes: 20
defaults:
run:
shell: bash
steps:
- name: Git clone
uses: actions/checkout@v6.0.2
- name: Set up Python
uses: actions/setup-python@v6.2.0
with:
python-version: "3.10"
# Reuse pip downloads/wheels between runs to speed up CI.
cache: pip
cache-dependency-path: pyproject.toml
- name: Install project with development extras
run: python -m pip install -e '.[dev]'
- name: Check linting
run: make lint
- name: Check format
run: make format
- name: Check static typing
run: make type-check
tests:
name: Tests (${{ matrix.name }})
runs-on: ${{ matrix.os }}
timeout-minutes: 60
env:
# Limit BLAS/OpenMP threads so xdist workers do not oversubscribe CPUs.
OMP_NUM_THREADS: "1"
OPENBLAS_NUM_THREADS: "1"
MKL_NUM_THREADS: "1"
NUMEXPR_NUM_THREADS: "1"
strategy:
# Keep running all matrix jobs to get complete compatibility signal.
fail-fast: false
matrix:
include:
# minimum supported dependencies
- name: minimum-supported
os: ubuntu-latest
python-version: "3.10"
use-pinned-deps: true
numpy-version: "==1.24.1"
sklearn-version: "==1.4.*"
scipy-version: "==1.10.*"
run-long-tests: true
# latest supported environments
- name: ubuntu-latest
os: ubuntu-latest
python-version: "3.13"
use-pinned-deps: false
run-long-tests: true
- name: windows-latest
os: windows-latest
python-version: "3.13"
use-pinned-deps: false
run-long-tests: false
- name: macos-latest
os: macos-latest
python-version: "3.13"
use-pinned-deps: false
run-long-tests: false
defaults:
run:
shell: bash
steps:
- name: Git clone
uses: actions/checkout@v6.0.2
- name: Set up Python
uses: actions/setup-python@v6.2.0
with:
python-version: ${{ matrix.python-version }}
# Reuse pip downloads/wheels between runs to speed up CI.
cache: pip
cache-dependency-path: pyproject.toml
- name: Install minimum dependency constraints
# Force the lowest supported dependency set for compatibility checks.
if: ${{ matrix.use-pinned-deps }}
run: |
python -m pip install "numpy${{ matrix.numpy-version }}" "scikit-learn${{ matrix.sklearn-version }}" "scipy${{ matrix.scipy-version }}"
- name: Install project with development extras
run: python -m pip install -e '.[dev]'
- name: Test and coverage with pytest
run: make coverage
- name: Long tests with pytest
# Skip on draft PRs to keep early feedback fast.
if: matrix.run-long-tests && (github.event_name == 'push' || !github.event.pull_request.draft)
run: make long-tests
latest-canary:
# Track upcoming Python and dependency updates without blocking merges.
name: Latest canary (non-blocking)
runs-on: ubuntu-latest
timeout-minutes: 60
continue-on-error: true
env:
# Limit BLAS/OpenMP threads so xdist workers do not oversubscribe CPUs.
OMP_NUM_THREADS: "1"
OPENBLAS_NUM_THREADS: "1"
MKL_NUM_THREADS: "1"
NUMEXPR_NUM_THREADS: "1"
defaults:
run:
shell: bash
steps:
- name: Git clone
uses: actions/checkout@v6.0.2
- name: Set up latest Python
uses: actions/setup-python@v6.2.0
with:
python-version: "3.x"
check-latest: true
cache: pip
cache-dependency-path: pyproject.toml
- name: Install project with development extras
run: python -m pip install -e '.[dev]'
- name: Upgrade core scientific dependencies
run: python -m pip install --upgrade numpy scikit-learn scipy
- name: Canary test and coverage with pytest
run: make coverage