-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathazure-pipelines.yml
153 lines (150 loc) · 5.35 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
trigger:
batch: false
branches:
include:
- 'main'
pr:
branches:
include:
- '*'
stages:
- stage: Check
jobs:
- job: Skip
pool:
vmImage: 'ubuntu-latest'
variables:
NO_SKIP: '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"
displayName: Retrieve git log
- bash: echo "##vso[task.setvariable variable=NO_SKIP]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]')))
displayName: Check for skip flags
- bash: echo "##vso[task.setvariable variable=start_main;isOutput=true]$NO_SKIP"
name: result
displayName: Store result in start_main
- stage: Tests
condition: and(succeeded(), eq(dependencies.Check.outputs['Skip.result.start_main'], 'true'))
dependsOn: ['Check']
jobs:
- job: pytest
timeoutInMinutes: 30
variables:
CACHE_PATH_MNE_LINUX: /home/vsts/mne_data
CACHE_PATH_MNE_MACOS: /Users/runner/mne_data
CACHE_PATH_MNE_WINDOWS: C:\Users\VssAdministrator\mne_data
CODECOV_OS: Linux
CODECOV_PYTHON_VERSION: 3.9
MPLBACKEND: agg
strategy:
matrix:
linux 3.7:
VM_IMAGE: 'ubuntu-latest'
PYTHON_VERSION: '3.7'
MNE_DEV: false
CACHE_MNE_PATH: $(CACHE_PATH_MNE_LINUX)
linux 3.8:
VM_IMAGE: 'ubuntu-latest'
PYTHON_VERSION: '3.8'
MNE_DEV: false
CACHE_MNE_PATH: $(CACHE_PATH_MNE_LINUX)
linux 3.9:
VM_IMAGE: 'ubuntu-latest'
PYTHON_VERSION: '3.9'
MNE_DEV: false
CACHE_MNE_PATH: $(CACHE_PATH_MNE_LINUX)
linux 3.10:
VM_IMAGE: 'ubuntu-latest'
PYTHON_VERSION: '3.10'
MNE_DEV: false
CACHE_MNE_PATH: $(CACHE_PATH_MNE_LINUX)
linux 3.10 MNE-dev:
VM_IMAGE: 'ubuntu-latest'
PYTHON_VERSION: '3.10'
MNE_DEV: true
CACHE_MNE_PATH: $(CACHE_PATH_MNE_LINUX)
macOS 3.7:
VM_IMAGE: 'macOS-latest'
PYTHON_VERSION: '3.7'
MNE_DEV: false
CACHE_MNE_PATH: $(CACHE_PATH_MNE_MACOS)
macOS 3.8:
VM_IMAGE: 'macOS-latest'
PYTHON_VERSION: '3.8'
MNE_DEV: false
CACHE_MNE_PATH: $(CACHE_PATH_MNE_MACOS)
macOS 3.9:
VM_IMAGE: 'macOS-latest'
PYTHON_VERSION: '3.9'
MNE_DEV: false
CACHE_MNE_PATH: $(CACHE_PATH_MNE_MACOS)
macOS 3.10:
VM_IMAGE: 'macOS-latest'
PYTHON_VERSION: '3.10'
MNE_DEV: false
CACHE_MNE_PATH: $(CACHE_PATH_MNE_MACOS)
windows 3.7:
VM_IMAGE: 'windows-latest'
PYTHON_VERSION: '3.7'
MNE_DEV: false
CACHE_MNE_PATH: $(CACHE_PATH_MNE_WINDOWS)
windows 3.8:
VM_IMAGE: 'windows-latest'
PYTHON_VERSION: '3.8'
MNE_DEV: false
CACHE_MNE_PATH: $(CACHE_PATH_MNE_WINDOWS)
windows 3.9:
VM_IMAGE: 'windows-latest'
PYTHON_VERSION: '3.9'
MNE_DEV: false
CACHE_MNE_PATH: $(CACHE_PATH_MNE_WINDOWS)
windows 3.10:
VM_IMAGE: 'windows-latest'
PYTHON_VERSION: '3.10'
MNE_DEV: false
CACHE_MNE_PATH: $(CACHE_PATH_MNE_WINDOWS)
pool:
vmImage: $(VM_IMAGE)
steps:
- task: UsePythonVersion@0
inputs:
versionSpec: $(PYTHON_VERSION)
architecture: 'x64'
addToPath: true
displayName: 'Setup Python $(PYTHON_VERSION)'
- script: |
python -m pip install --progress-bar off --upgrade pip setuptools wheel
python -m pip install --progress-bar off .[test]
displayName: 'Install dependencies and MNE (stable)'
- script: |
python -m pip uninstall -y mne
python -m pip install --progress-bar off --no-deps https://github.com/mne-tools/mne-python/archive/main.zip
condition: eq(variables.MNE_DEV, 'true')
displayName: 'Install MNE (main)'
- script: mne sys_info -pd
displayName: 'Display MNE config'
- script: |
curl https://raw.githubusercontent.com/mne-tools/mne-testing-data/master/version.txt -o mne_testing_data_version.txt
displayName: "Retrieve MNE testing dataset version"
- task: Cache@2
inputs:
key: '"mne_testing_data" | mne_testing_data_version.txt'
path: $(CACHE_MNE_PATH)
cacheHitVar: CACHE_MNE_RESTORED
displayName: 'Cache MNE testing dataset'
- script: python -c "import mne; mne.datasets.testing.data_path(verbose=True)"
displayName: 'Get MNE testing datataset'
condition: ne(variables.CACHE_MNE_RESTORED, 'true')
- script: pytest pycartool --junitxml=junit/test-results.xml --cov=pycartool --cov-report=xml
displayName: 'Run unit tests'
- task: PublishCodeCoverageResults@1
inputs:
codeCoverageTool: Cobertura
summaryFileLocation: '$(System.DefaultWorkingDirectory)/**/coverage.xml'
- bash: bash <(curl -s https://codecov.io/bash)
condition: and(eq(variables['Agent.OS'], variables.CODECOV_OS), eq(variables.PYTHON_VERSION, variables.CODECOV_PYTHON_VERSION))
displayName: 'Upload to codecov.io'