-
Notifications
You must be signed in to change notification settings - Fork 34
289 lines (259 loc) · 8.88 KB
/
test.yml
File metadata and controls
289 lines (259 loc) · 8.88 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
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
name: CI
permissions:
contents: read
on:
push:
branches:
- master
pull_request:
branches:
- master
schedule:
# Daily build at 1:00 AM UTC
- cron: "0 1 * * *"
# Cancel in-progress workflows when pushing
# a new commit on the same branch
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
linting:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: "3.12"
- name: Install black
run: |
pip install black==25.1.0
- name: Run black
run: |
black --check --diff .
testing:
needs: linting
timeout-minutes: 30
strategy:
fail-fast: false
matrix:
include:
# Windows env with numpy, scipy,MKL installed through conda-forge
- name: pylatest_conda_forge_mkl
os: windows-latest
PYTHON_VERSION: "*"
PACKAGER: "conda-forge"
BLAS: "mkl"
# Windows env with numpy, scipy, OpenBLAS installed through conda-forge
- name: py311_conda_forge_openblas
os: windows-latest
PYTHON_VERSION: "3.11"
PACKAGER: "conda-forge"
BLAS: "openblas"
# Windows env with numpy, scipy installed through conda
- name: py310_conda
os: windows-latest
PYTHON_VERSION: "3.10"
PACKAGER: "conda"
# Windows env with numpy, scipy installed through pip
- name: py39_pip
os: windows-latest
PYTHON_VERSION: "3.9"
PACKAGER: "pip"
# MacOS env with OpenMP installed through homebrew
- name: py39_conda_homebrew_libomp
os: macos-latest
PYTHON_VERSION: "3.9"
PACKAGER: "conda"
BLAS: "openblas"
CC_OUTER_LOOP: "clang"
CC_INNER_LOOP: "clang"
INSTALL_LIBOMP: "homebrew"
# MacOS env with OpenBLAS and OpenMP installed through conda-forge compilers
- name: pylatest_conda_forge_clang_openblas
os: macos-latest
PYTHON_VERSION: "*"
PACKAGER: "conda-forge"
BLAS: "openblas"
INSTALL_LIBOMP: "conda-forge"
# MacOS env with FlexiBLAS
- name: pylatest_flexiblas
os: macos-latest
PYTHON_VERSION: "*"
INSTALL_BLAS: "flexiblas"
PLATFORM_SPECIFIC_PACKAGES: "llvm-openmp"
# Linux environments to test that packages that comes with Ubuntu 22.04
# are correctly handled.
- name: py39_ubuntu_atlas_gcc_gcc
os: ubuntu-22.04
PYTHON_VERSION: "3.9"
PACKAGER: "ubuntu"
APT_BLAS: "libatlas3-base libatlas-base-dev"
CC_OUTER_LOOP: "gcc"
CC_INNER_LOOP: "gcc"
- name: py39_ubuntu_openblas_gcc_gcc
os: ubuntu-22.04
PYTHON_VERSION: "3.9"
PACKAGER: "ubuntu"
APT_BLAS: "libopenblas-base libopenblas-dev"
CC_OUTER_LOOP: "gcc"
CC_INNER_LOOP: "gcc"
# Linux environment with development versions of numpy and scipy
- name: pylatest_pip_dev
os : ubuntu-latest
PACKAGER: "pip-dev"
PYTHON_VERSION: "*"
CC_OUTER_LOOP: "gcc"
CC_INNER_LOOP: "gcc"
# Linux + Python 3.9 and homogeneous runtime nesting.
- name: py39_conda_openblas_clang_clang
os: ubuntu-latest
PACKAGER: "conda"
PYTHON_VERSION: "3.9"
BLAS: "openblas"
CC_OUTER_LOOP: "clang-18"
CC_INNER_LOOP: "clang-18"
# Linux environment with MKL and Clang (known to be unsafe for
# threadpoolctl) to only test the warning from multiple OpenMP.
- name: pylatest_conda_mkl_clang_gcc
os: ubuntu-latest
PYTHON_VERSION: "*"
PACKAGER: "conda"
BLAS: "mkl"
CC_OUTER_LOOP: "clang-18"
CC_INNER_LOOP: "gcc"
TESTS: "libomp_libiomp_warning"
# Linux environment with MKL, safe for threadpoolctl.
- name: pylatest_conda_mkl_gcc_gcc
os: ubuntu-latest
PYTHON_VERSION: "*"
PACKAGER: "conda"
BLAS: "mkl"
CC_OUTER_LOOP: "gcc"
CC_INNER_LOOP: "gcc"
MKL_THREADING_LAYER: "INTEL"
# Linux + Python 3.11 with numpy / scipy installed with pip from PyPI
# and heterogeneous OpenMP runtimes.
- name: py311_pip_openblas_gcc_clang
os: ubuntu-latest
PACKAGER: "pip"
PYTHON_VERSION: "3.11"
CC_OUTER_LOOP: "gcc"
CC_INNER_LOOP: "clang-18"
# Linux environment with numpy from conda-forge channel and openblas-openmp
- name: pylatest_conda_forge
os: ubuntu-latest
PACKAGER: "conda-forge"
PYTHON_VERSION: "*"
BLAS: "openblas"
OPENBLAS_THREADING_LAYER: "openmp"
CC_OUTER_LOOP: "gcc"
CC_INNER_LOOP: "gcc"
# Linux environment with no numpy and heterogeneous OpenMP runtimes.
- name: pylatest_conda_nonumpy_gcc_clang
os: ubuntu-latest
PACKAGER: "conda"
PYTHON_VERSION: "*"
NO_NUMPY: "true"
CC_OUTER_LOOP: "gcc"
CC_INNER_LOOP: "clang-18"
# Linux environments with numpy linked to BLIS
- name: pylatest_blis_gcc_clang_openmp
os: ubuntu-latest
PYTHON_VERSION: "*"
INSTALL_BLAS: "blis"
BLIS_NUM_THREAEDS: "4"
CC_OUTER_LOOP: "gcc"
CC_INNER_LOOP: "gcc"
BLIS_CC: "clang-18"
BLIS_ENABLE_THREADING: "openmp"
- name: pylatest_blis_clang_gcc_pthreads
os: ubuntu-latest
PYTHON_VERSION: "*"
INSTALL_BLAS: "blis"
BLIS_NUM_THREADS: "4"
CC_OUTER_LOOP: "clang-18"
CC_INNER_LOOP: "clang-18"
BLIS_CC: "gcc-12"
BLIS_ENABLE_THREADING: "pthreads"
- name: pylatest_blis_no_threading
os: ubuntu-latest
PYTHON_VERSION: "*"
INSTALL_BLAS: "blis"
BLIS_NUM_THREADS: "1"
CC_OUTER_LOOP: "gcc"
CC_INNER_LOOP: "gcc"
BLIS_CC: "gcc-12"
BLIS_ENABLE_THREADING: "no"
# Linux env with FlexiBLAS
- name: pylatest_flexiblas
os: ubuntu-latest
PYTHON_VERSION: "*"
INSTALL_BLAS: "flexiblas"
PLATFORM_SPECIFIC_PACKAGES: "mkl"
CC_OUTER_LOOP: "gcc"
CC_INNER_LOOP: "gcc"
env: ${{ matrix }}
runs-on: ${{ matrix.os }}
defaults:
run:
# Need to use this shell to get conda working properly.
# See https://github.com/marketplace/actions/setup-miniconda#important
shell: ${{ matrix.os == 'windows-latest' && 'cmd /C CALL {0}' || 'bash -el {0}' }}
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Setup conda
uses: conda-incubator/setup-miniconda@v3
with:
auto-activate-base: true
auto-update-conda: true
miniforge-version: latest
- name: Install dependencies
run: |
bash -el continuous_integration/install.sh
- name: Test library
run: |
bash -el continuous_integration/run_tests.sh
- name: Upload test results
uses: actions/upload-artifact@v4
with:
# Requires a unique name for each job in the matrix of this run
name: test_result_${{github.run_id}}_${{ matrix.os }}_${{ matrix.name }}
path: test_result.xml
retention-days: 1
- name: Upload to Codecov
uses: codecov/codecov-action@v5
with:
files: coverage.xml
# Meta-test to ensure that at least one of the above CI configurations had
# the necessary platform settings to execute each test without raising
# skipping.
meta_test:
needs: testing
runs-on: ubuntu-latest
steps:
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: "3.12"
- name: Checkout code
uses: actions/checkout@v3
- name: Download tests results
uses: actions/download-artifact@v4
with:
path: test_results
- name: Check no test always skipped
run: |
python continuous_integration/check_no_test_skipped.py test_results
stubtest:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: "3.9"
- name: Install dependencies
run: pip install mypy .
- name: Run stubtest
run: stubtest threadpoolctl