forked from mne-tools/mne-python
-
Notifications
You must be signed in to change notification settings - Fork 0
/
azure-pipelines.yml
325 lines (315 loc) · 11.7 KB
/
azure-pipelines.yml
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
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
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: Style
variables:
AZURE_CI: 'true'
jobs:
- job: All
pool:
vmImage: 'ubuntu-latest'
variables:
PYTHON_VERSION: '3.9'
PYTHON_ARCH: 'x64'
steps:
- bash: echo $(COMMIT_MSG)
- task: UsePythonVersion@0
inputs:
versionSpec: $(PYTHON_VERSION)
architecture: $(PYTHON_ARCH)
addToPath: true
displayName: 'Get Python'
- bash: |
set -e
python -m pip install --progress-bar off --upgrade pip setuptools wheel
python -m pip install --progress-bar off -r requirements_base.txt -r requirements_hdf5.txt -r requirements_testing.txt
displayName: Install dependencies
condition: always()
- bash: |
make pydocstyle
displayName: make pydocstyle
condition: always()
- bash: |
make docstring
displayName: make docstring
- bash: |
make nesting
displayName: make nesting
condition: always()
- bash: |
make check-manifest
displayName: make check-manifest
condition: always()
- bash: |
make check-readme
displayName: make check-readme
condition: always()
- stage: Test
condition: and(succeeded(), eq(dependencies.Check.outputs['Skip.result.start_main'], 'true'))
dependsOn: Check
variables:
AZURE_CI: 'true'
jobs:
- job: Ultraslow_PG
pool:
vmImage: 'ubuntu-20.04'
variables:
DISPLAY: ':99'
OPENBLAS_NUM_THREADS: '1'
steps:
- bash: |
sudo apt install libxkbcommon-x11-0 xvfb tcsh libxcb*
displayName: 'Install Ubuntu dependencies'
- bash: |
source tools/get_minimal_commands.sh
displayName: 'Install minimal commands'
- bash: |
echo $PATH
mne_surf2bem --version
fsl_rigid_register --version
displayName: 'Test minimal commands'
- task: UsePythonVersion@0
inputs:
versionSpec: '3.8'
architecture: 'x64'
addToPath: true
displayName: 'Get Python'
- bash: |
/sbin/start-stop-daemon --start --quiet --pidfile /tmp/custom_xvfb_99.pid --make-pidfile --background --exec /usr/bin/Xvfb -- :99 -screen 0 1400x900x24 -ac +extension GLX +render -noreset;
displayName: 'Spin up Xvfb'
- bash: |
set -e
python -m pip install --progress-bar off --upgrade pip setuptools wheel codecov
python -m pip install --progress-bar off mne-qt-browser[opengl]
python -m pip uninstall -yq mne
python -m pip install --progress-bar off --upgrade -e .[test]
displayName: 'Install dependencies with pip'
- script: mne sys_info -pd
displayName: Print config
- bash: source tools/get_testing_version.sh
displayName: 'Get testing version'
- task: Cache@2
inputs:
key: $(testing_version)
path: /home/vsts/mne_data
displayName: 'Cache testing data'
- script: python -c "import mne; mne.datasets.testing.data_path(verbose=True)"
displayName: 'Get test data'
- script: pytest -m "ultraslowtest or pgtest" --tb=short --cov=mne --cov-report=xml --cov-report=html -vv mne
displayName: 'Run ultraslow and PyQtGraph mne-qt-browser tests'
- bash: bash <(curl -s https://codecov.io/bash)
displayName: 'Codecov'
condition: succeededOrFailed()
- task: PublishTestResults@2
inputs:
testResultsFiles: '**/junit-*.xml'
testRunTitle: 'Publish test results for $(Agent.JobName)'
failTaskOnFailedTests: true
condition: succeededOrFailed()
- task: PublishCodeCoverageResults@1
inputs:
codeCoverageTool: Cobertura
summaryFileLocation: '$(System.DefaultWorkingDirectory)/**/coverage.xml'
reportDirectory: '$(System.DefaultWorkingDirectory)/**/htmlcov'
- job: Notebook
pool:
vmImage: 'ubuntu-latest'
steps:
- bash: |
set -e
wget https://repo.continuum.io/miniconda/Miniconda3-latest-Linux-x86_64.sh -O miniconda.sh --progress=dot:mega
bash miniconda.sh -b -p ~/miniconda
source ~/miniconda/etc/profile.d/conda.sh
conda activate base
conda env update --file server_environment.yml
pip uninstall -yq mne
pip install --progress-bar off -ve .[test] codecov
echo "##vso[task.setvariable variable=PATH]${PATH}"
echo "##vso[task.setvariable variable=LD_LIBRARY_PATH]${LD_LIBRARY_PATH}"
displayName: 'Install dependencies'
- script: mne sys_info -pd
displayName: 'Print config'
- bash: source tools/get_testing_version.sh
displayName: 'Get testing version'
- task: Cache@2
inputs:
key: $(testing_version)
path: /home/vsts/mne_data
displayName: 'Cache testing data'
- script: python -c "import mne; mne.datasets.testing.data_path(verbose=True)"
displayName: 'Get test data'
- script: pytest --tb=short -m "not pgtest" --cov=mne --cov-report=xml --cov-report=html -vv mne/viz
displayName: 'Run viz tests'
- bash: bash <(curl -s https://codecov.io/bash)
displayName: 'Codecov'
condition: succeededOrFailed()
- task: PublishTestResults@2
inputs:
testResultsFiles: '**/junit-*.xml'
testRunTitle: 'Publish test results for $(Agent.JobName)'
failTaskOnFailedTests: true
condition: succeededOrFailed()
- task: PublishCodeCoverageResults@1
inputs:
codeCoverageTool: Cobertura
summaryFileLocation: '$(System.DefaultWorkingDirectory)/**/coverage.xml'
reportDirectory: '$(System.DefaultWorkingDirectory)/**/htmlcov'
- job: Windows
pool:
vmImage: 'windows-latest'
variables:
MNE_LOGGING_LEVEL: 'warning'
MNE_FORCE_SERIAL: 'true'
OPENBLAS_NUM_THREADS: 1
OMP_NUM_THREADS: 1
MKL_NUM_THREADS: 2
OMP_DYNAMIC: 'false'
MKL_DYNAMIC: 'false'
PYTHONUNBUFFERED: 1
PYTHONIOENCODING: 'utf-8'
AZURE_CI_WINDOWS: 'true'
PYTHON_ARCH: 'x64'
strategy:
maxParallel: 4
matrix:
3.9 conda:
PLATFORM: 'x86-64'
TEST_MODE: 'conda'
PYTHON_VERSION: '3.9'
3.7 pip:
TEST_MODE: 'pip'
PYTHON_VERSION: '3.7'
3.9 pip pre:
TEST_MODE: 'pip-pre'
PYTHON_VERSION: '3.9'
steps:
- task: UsePythonVersion@0
inputs:
versionSpec: $(PYTHON_VERSION)
architecture: $(PYTHON_ARCH)
addToPath: true
condition: in(variables['TEST_MODE'], 'pip', 'pip-pre')
displayName: 'Get Python'
# https://docs.microsoft.com/en-us/azure/devops/pipelines/ecosystems/anaconda
# https://github.com/MicrosoftDocs/pipelines-anaconda
# https://github.com/ContinuumIO/anaconda-issues/issues/10949
- script: |
echo "##vso[task.prependpath]%CONDA%;%CONDA%\condabin;%CONDA%\Scripts;%CONDA%\Library\bin;%PROGRAMFILES%\Git\bin;%SystemRoot%\system32;%SystemRoot%;%SystemRoot%\System32\Wbem;%PROGRAMFILES%\Git\usr\bin"
condition: in(variables['TEST_MODE'], 'conda')
displayName: Add conda to PATH, deal with Qt linking bug
- bash: |
set -e
git clone --depth 1 https://github.com/pyvista/gl-ci-helpers.git
powershell gl-ci-helpers/appveyor/install_opengl.ps1
displayName: Install OpenGL
- bash: |
set -e
./tools/azure_dependencies.sh
condition: in(variables['TEST_MODE'], 'pip', 'pip-pre')
displayName: Install dependencies with pip
- script: conda env update --name base --file environment.yml
condition: eq(variables['TEST_MODE'], 'conda')
displayName: Setup MNE environment
- bash: |
set -e
conda remove -c conda-forge --force -yq mne
rm /c/Miniconda/Scripts/mne.exe
condition: eq(variables['TEST_MODE'], 'conda')
displayName: Remove old MNE
- script: pip install -e .
displayName: 'Install MNE-Python dev'
- script: pip install --progress-bar off -e .[test] codecov
condition: eq(variables['TEST_MODE'], 'conda')
displayName: Install testing requirements
- script: mne sys_info -pd
displayName: 'Print config'
- script: python -c "import numpy; numpy.show_config()"
displayName: Print NumPy config
- bash: source tools/get_testing_version.sh
displayName: 'Get testing version'
- task: Cache@2
inputs:
key: $(testing_version)
path: C:\Users\VssAdministrator\mne_data
displayName: 'Cache testing data'
- script: python -c "import mne; mne.datasets.testing.data_path(verbose=True)"
displayName: 'Get test data'
- script: pytest -m "not (slowtest or pgtest)" --tb=short --cov=mne --cov-report=xml --cov-report=html -vv mne
displayName: 'Run tests'
- bash: bash <(curl -s https://codecov.io/bash)
displayName: 'Codecov'
condition: succeededOrFailed()
- task: PublishTestResults@2
inputs:
testResultsFiles: '**/junit-*.xml'
testRunTitle: 'Publish test results for $(Agent.JobName) $(TEST_MODE) $(PYTHON_VERSION)'
failTaskOnFailedTests: true
condition: succeededOrFailed()
- task: PublishCodeCoverageResults@1
inputs:
codeCoverageTool: Cobertura
summaryFileLocation: '$(System.DefaultWorkingDirectory)/**/coverage.xml'
reportDirectory: '$(System.DefaultWorkingDirectory)/**/htmlcov'
- job: SphinxWindows
pool:
vmImage: 'windows-latest'
variables:
AZURE_CI_WINDOWS: 'true'
PYTHON_ARCH: 'x64'
PLATFORM: 'x86-64'
PYTHON_VERSION: '3.9'
steps:
- bash: |
set -e
git clone --depth 1 https://github.com/pyvista/gl-ci-helpers.git
powershell gl-ci-helpers/appveyor/install_opengl.ps1
displayName: Install OpenGL
- script: echo "##vso[task.prependpath]%CONDA%;%CONDA%\condabin;%CONDA%\Scripts;%CONDA%\Library\bin;%CONDA%\Library\bin\graphviz;%PROGRAMFILES%\Git\bin;%SystemRoot%\system32;%SystemRoot%;%SystemRoot%\System32\Wbem;%PROGRAMFILES%\Git\usr\bin"
displayName: Add conda to PATH, deal with Qt linking bug
- script: conda update -n base -c defaults conda
displayName: Update conda
- script: conda env update --name base --file environment.yml
displayName: Setup MNE environment
- script: conda install -c conda-forge graphviz
displayName: Add graphviz dot
- bash: |
set -e
conda remove -c conda-forge --force -yq mne
rm /c/Miniconda/Scripts/mne.exe
displayName: Remove old MNE
- script: pip install -e .
displayName: Install dev MNE
- script: pip install --progress-bar off -r requirements_doc.txt
displayName: Install documentation dependencies
- script: mne sys_info -pd
displayName: Print config and test access to commands
- script: python -c "import numpy; numpy.show_config()"
displayName: Print NumPy config
- bash: make -C doc html_dev-noplot
displayName: 'Build doc'