forked from mne-tools/mne-python
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathazure-pipelines.yml
More file actions
286 lines (280 loc) · 13.3 KB
/
Copy pathazure-pipelines.yml
File metadata and controls
286 lines (280 loc) · 13.3 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
trigger:
# start a new build for every push
batch: false
branches:
include:
- 'main'
- 'maint/*'
pr:
branches:
include:
- '*' # must quote since "*" is a YAML reserved character; we want a string
stages:
- stage: Check
jobs:
- job: Skip
pool:
vmImage: 'ubuntu-latest'
variables:
DECODE_PERCENTS: 'false'
RET: 'true'
BUILD_REASON: $(Build.Reason)
steps:
- bash: |
git_log=`git log --format=oneline -n 1 --skip=1`
echo "##vso[task.setvariable variable=log]$git_log"
- bash: echo "##vso[task.setvariable variable=RET]false"
condition: and(eq(variables.BUILD_REASON, 'PullRequest'), or(contains(variables.log, '[skip azp]'), contains(variables.log, '[azp skip]'), contains(variables.log, '[skip ci]'), contains(variables.log, '[ci skip]')))
- bash: echo "##vso[task.setvariable variable=start_main;isOutput=true]$RET"
name: result
- stage: Test
condition: and(succeeded(), eq(dependencies.Check.outputs['Skip.result.start_main'], 'true'))
dependsOn: ['Check']
variables:
AZURE_CI: 'true'
jobs:
- job: Linux_Ultraslow_PG
timeoutInMinutes: 40
pool:
vmImage: 'ubuntu-latest'
variables:
MNE_TOOLS_DIR: '$(Pipeline.Workspace)/mne-tools'
DISPLAY: ':99'
PYTEST_XDIST_N: '2' # Microsoft-hosted agents have 2 cores
MNE_TEST_ALLOW_SKIP: '^$' # nothing
MNE_BROWSER_PRECOMPUTE: 'false'
# See tools/github_actions_env_vars.sh for why these are set (this job
# is on Python 3.14, so sys.monitoring can measure branches)
COVERAGE_CORE: 'sysmon'
UV_CACHE_DIR: '/home/vsts/.cache/uv'
UV_SYSTEM_PYTHON: 'true' # UsePythonVersion gives us a bare interpreter, not a venv
UV_NO_PROGRESS: 'true'
steps:
- bash: |
set -xeo pipefail
git clone --depth 1 https://github.com/mne-tools/mne-tools.git "$MNE_TOOLS_DIR"
displayName: Clone mne-tools
- bash: $(MNE_TOOLS_DIR)/tools/setup_xvfb.sh
displayName: Setup up Xvfb
- task: Cache@2
inputs:
key: '"minimal-cmds" | "$(Agent.OS)" | $(MNE_TOOLS_DIR)/tools/get_minimal_commands.sh'
path: /home/vsts/minimal_cmds
displayName: Cache minimal commands
- bash: $(MNE_TOOLS_DIR)/tools/get_minimal_commands.sh
displayName: Get minimal commands
- task: UsePythonVersion@0
inputs:
versionSpec: '3.14'
architecture: 'x64'
addToPath: true
- task: Cache@2
inputs:
key: '"uv" | "$(Agent.OS)" | pyproject.toml'
restoreKeys: '"uv" | "$(Agent.OS)"'
path: $(UV_CACHE_DIR)
displayName: Cache uv
- bash: |
set -xeo pipefail
python -m pip install --progress-bar off --upgrade "uv>=0.9"
uv pip install --upgrade --only-binary=":all:" --no-binary=mne --no-binary=mne-qt-browser -e . --group=test "mne-qt-browser @ https://github.com/mne-tools/mne-qt-browser/archive/refs/heads/main.zip" pyvista scikit-learn python-picard qtpy nibabel sphinx-gallery "PySide6!=6.8.0,!=6.8.0.1,!=6.8.1.1,!=6.9.1" pandas neo pymatreader antio defusedxml curryreader pymef openmeeg
displayName: Install dependencies with uv
- bash: $(MNE_TOOLS_DIR)/tools/check_qt_import.sh PySide6
displayName: Check Qt import
- bash: |
set -xeo pipefail
mne sys_info -pd
mne sys_info -pd | grep "qtpy .*(PySide6=.*)$"
displayName: Print config
- bash: ./tools/get_testing_version.sh
displayName: Get testing version
- task: Cache@2
inputs:
key: mne_data-testing-$(testing_version)-misc-$(misc_version)
path: /home/vsts/mne_data
displayName: Cache testing data
- bash: ./tools/github_actions_download.sh
displayName: Download testing data
- script: pytest -m "ultraslowtest or pgtest" -n $(PYTEST_XDIST_N) --dist loadscope --tb=short --cov=mne --cov-report=xml -vv mne
displayName: slow and mne-qt-browser tests
- bash: bash <(curl -s https://codecov.io/bash)
displayName: Codecov
condition: succeededOrFailed()
env:
CODECOV_TOKEN: $(CODECOV_TOKEN)
- job: Linux_Qt_Bindings
timeoutInMinutes: 30
pool:
vmImage: 'ubuntu-latest'
variables:
MNE_TOOLS_DIR: '$(Pipeline.Workspace)/mne-tools'
DISPLAY: ':99'
PYTEST_XDIST_N: '2' # Microsoft-hosted agents have 2 cores
TEST_OPTIONS: "--tb=short --cov=mne --cov-report=xml --cov-append -vv mne/gui mne/viz/_brain mne/viz/backends mne/viz/tests/test_evoked.py mne/report"
MNE_TEST_ALLOW_SKIP: '^$' # nothing (can be overridden below)
# See tools/github_actions_env_vars.sh; this job is on Python 3.14
COVERAGE_CORE: 'sysmon'
steps:
- bash: |
set -xeo pipefail
git clone --depth 1 https://github.com/mne-tools/mne-tools.git "$MNE_TOOLS_DIR"
displayName: Clone mne-tools
- bash: $(MNE_TOOLS_DIR)/tools/setup_xvfb.sh
displayName: Setup up Xvfb
- task: UsePythonVersion@0
inputs:
versionSpec: '3.14'
architecture: 'x64'
addToPath: true
- bash: |
set -xeo pipefail
python -m pip install --progress-bar off --upgrade pip
python -m pip install --progress-bar off --upgrade --only-binary=":all:" -e .[full-pyside6] --group=test_extra "mne-qt-browser @ https://github.com/mne-tools/mne-qt-browser/archive/refs/heads/main.zip"
python -c "import vtk"
displayName: Install dependencies with pip
- bash: |
set -xeo pipefail
which mne
mne sys_info -pd
python ./tools/check_mne_location.py
displayName: Print config
- bash: ./tools/get_testing_version.sh
displayName: Get testing version
- task: Cache@2
inputs:
key: mne_data-testing-$(testing_version)-misc-$(misc_version)
path: /home/vsts/mne_data
displayName: Cache testing data
- bash: ./tools/github_actions_download.sh
displayName: Download testing data
- bash: $(MNE_TOOLS_DIR)/tools/check_qt_import.sh PySide6
displayName: Check Qt import
- bash: |
set -xeo pipefail
mne sys_info -pd
mne sys_info -pd | grep "qtpy .* (PySide6=.*)$"
export MNE_TEST_ALLOW_SKIP="^.*PySide6 causes segfaults.*$"
PYTEST_QT_API=PySide6 pytest -m "not ultraslowtest" -n $(PYTEST_XDIST_N) --dist loadscope --timeout=120 --timeout-method=thread -o faulthandler_timeout=110 ${TEST_OPTIONS}
python -m pip uninstall -yq PySide6
displayName: PySide6
- bash: |
set -xeo pipefail
python -m pip install PyQt6
mne sys_info -pd
mne sys_info -pd | grep "qtpy .* (PyQt6=.*)$"
PYTEST_QT_API=PyQt6 pytest -m "not ultraslowtest" -n $(PYTEST_XDIST_N) --dist loadscope --timeout=120 --timeout-method=thread -o faulthandler_timeout=110 ${TEST_OPTIONS}
python -m pip uninstall -yq PyQt6 PyQt6-sip PyQt6-Qt6
displayName: PyQt6
- bash: bash <(curl -s https://codecov.io/bash)
displayName: Codecov
condition: succeededOrFailed()
env:
CODECOV_TOKEN: $(CODECOV_TOKEN)
- job: Windows
pool:
vmImage: 'windows-latest'
variables:
MNE_TOOLS_DIR: '$(Pipeline.Workspace)/mne-tools'
MNE_LOGGING_LEVEL: 'warning'
MNE_FORCE_SERIAL: 'true'
PYTEST_XDIST_N: '2' # Microsoft-hosted agents have 2 cores
OMP_DYNAMIC: 'false'
PYTHONUNBUFFERED: 1
# See tools/github_actions_env_vars.sh; both matrix legs are Python 3.14
COVERAGE_CORE: 'sysmon'
# See tools/github_actions_env_vars.sh for why these three are set
NUMBA_CACHE_DIR: 'C:\Users\VssAdministrator\.cache\mne-numba'
NUMBA_CPU_NAME: 'generic'
NUMBA_CPU_FEATURES: ''
UV_CACHE_DIR: 'C:\Users\VssAdministrator\.cache\uv'
UV_SYSTEM_PYTHON: 'true' # UsePythonVersion gives us a bare interpreter, not a venv
UV_NO_PROGRESS: 'true'
AZURE_CI_WINDOWS: 'true'
MNE_CI_KIND: $(TEST_MODE)
MNE_TEST_ALLOW_SKIP: $(MNE_TEST_ALLOW_SKIP)
timeoutInMinutes: 40
strategy:
maxParallel: 4
matrix:
3.14 pip:
TEST_MODE: 'pip'
PYTHON_VERSION: '3.14'
MNE_TEST_ALLOW_SKIP: "^.*(Requires (spm|brainstorm) dataset|Requires FreeSurfer|CUDA not|on Windows|MNE_FORCE_SERIAL|PySide6 causes segfaults|SCIPY_ARRAY_API).*$"
3.14 pip pre:
TEST_MODE: 'pip-pre'
PYTHON_VERSION: '3.14'
MNE_TEST_ALLOW_SKIP: "^.*(Requires (spm|brainstorm) dataset|Requires FreeSurfer|CUDA not|Numba not|on Windows|MNE_FORCE_SERIAL|PySide6 causes segfaults|SCIPY_ARRAY_API).*$"
steps:
- task: UsePythonVersion@0
inputs:
versionSpec: $(PYTHON_VERSION)
architecture: 'x64'
addToPath: true
- bash: |
set -xeo pipefail
git clone --depth 1 https://github.com/mne-tools/mne-tools.git "$MNE_TOOLS_DIR"
displayName: Clone mne-tools
- task: Cache@2
inputs:
key: '"minimal-cmds" | "$(Agent.OS)" | $(MNE_TOOLS_DIR)/tools/get_minimal_commands.sh'
path: C:\Users\VssAdministrator\minimal_cmds
displayName: Cache minimal commands
# MNE_TOOLS_DIR is a Windows path and these steps run under Git Bash, hence
# cygpath; backticks rather than $(...) so Azure does not read it as a macro
- bash: |
set -eo pipefail
MNE_TOOLS_UNIX=`cygpath -u "$MNE_TOOLS_DIR"`
bash "$MNE_TOOLS_UNIX/tools/get_minimal_commands.sh"
displayName: Get minimal commands
- bash: |
set -xeo pipefail
git clone --depth 1 https://github.com/pyvista/setup-headless-display-action.git
MESA3D_VERSION=24.3.0 bash setup-headless-display-action/windows/install_opengl.sh
displayName: Install OpenGL
- task: Cache@2
inputs:
key: '"uv" | "$(Agent.OS)" | "$(PYTHON_VERSION)" | "$(TEST_MODE)" | pyproject.toml'
restoreKeys: '"uv" | "$(Agent.OS)" | "$(PYTHON_VERSION)" | "$(TEST_MODE)"'
path: $(UV_CACHE_DIR)
displayName: Cache uv
- bash: ./tools/azure_dependencies.sh
displayName: Install dependencies
- script: uv pip install --only-binary=":all:" --no-binary=mne -e .
displayName: Install mne
- script: mne sys_info -pd
displayName: Print config
- script: python -c "import numpy; numpy.show_config()"
displayName: Print NumPy config
- script: python -c "import numpy; import scipy.linalg; import sklearn.neighbors; from threadpoolctl import threadpool_info; from pprint import pprint; pprint(threadpool_info())"
displayName: Print threadpoolctl info
- bash: ./tools/get_testing_version.sh
displayName: Get testing version
- task: Cache@2
inputs:
key: mne_data-testing-$(testing_version)-misc-$(misc_version)
path: C:\Users\VssAdministrator\mne_data
displayName: Cache testing data
- bash: ./tools/github_actions_download.sh
displayName: Download testing data
- bash: ./tools/get_numba_version.sh
displayName: Get numba version
- task: Cache@2
inputs:
key: 'mne_numba | "$(Agent.OS)" | "$(PYTHON_VERSION)" | "$(numba_version)" | mne/**/*numba*.py'
path: C:\Users\VssAdministrator\.cache\mne-numba
displayName: Cache numba
# pip-pre has no numba when nightly wheels are missing; without it
# nothing creates the cache dir and the post-job save fails on tar
condition: ne(variables['numba_version'], 'none')
# Windows does not define HOME, and MNE-C dereferences it unconditionally:
# mne_forward_solution crashes with 0xC0000005 without it. Set after the
# steps above so that Git Bash keeps deriving its own MSYS-style HOME.
- script: 'echo ##vso[task.setvariable variable=HOME]%USERPROFILE%'
displayName: Set HOME for MNE-C
- script: pytest -m "not (slowtest or pgtest)" -n $(PYTEST_XDIST_N) --dist loadscope --timeout=120 --timeout-method=thread -o faulthandler_timeout=110 --tb=short --cov=mne --cov-report=xml -vv mne
displayName: Run tests
- bash: bash <(curl -s https://codecov.io/bash)
displayName: Codecov
condition: succeededOrFailed()
env:
CODECOV_TOKEN: $(CODECOV_TOKEN)