@@ -8,66 +8,65 @@ schedules:
8
8
always : true
9
9
10
10
jobs :
11
- - job : linting
12
- displayName : Linting
11
+ - job : git_commit
12
+ displayName : Get Git Commit
13
13
pool :
14
14
vmImage : ubuntu-18.04
15
15
steps :
16
- - task : UsePythonVersion@0
17
- inputs :
18
- versionSpec : ' 3.9'
19
- - bash : |
20
- pip install flake8 mypy==0.782
21
- displayName: Install linters
22
16
- bash : |
23
17
set -ex
24
18
if [[ $BUILD_REASON == "PullRequest" ]]; then
25
19
# By default pull requests use refs/pull/PULL_ID/merge as the source branch
26
20
# which has a "Merge ID into ID" as a commit message. The latest commit
27
21
# message is the second to last commit
28
22
COMMIT_ID=$(echo $BUILD_SOURCEVERSIONMESSAGE | awk '{print $2}')
29
- COMMIT_MESSAGE =$(git log $COMMIT_ID -1 --pretty=%B)
23
+ message =$(git log $COMMIT_ID -1 --pretty=%B)
30
24
else
31
- COMMIT_MESSAGE =$BUILD_SOURCEVERSIONMESSAGE
25
+ message =$BUILD_SOURCEVERSIONMESSAGE
32
26
fi
33
- echo "##vso[task.setvariable variable=COMMIT_MESSAGE]$COMMIT_MESSAGE"
27
+ echo "##vso[task.setvariable variable=message;isOutput=true]$message"
28
+ name: commit
34
29
displayName: Get source version message
30
+
31
+ - job : linting
32
+ dependsOn : [git_commit]
33
+ condition : |
34
+ and(
35
+ succeeded(),
36
+ not(contains(dependencies['git_commit']['outputs']['commit.message'], '[lint skip]')),
37
+ not(contains(dependencies['git_commit']['outputs']['commit.message'], '[ci skip]'))
38
+ )
39
+ displayName : Linting
40
+ pool :
41
+ vmImage : ubuntu-18.04
42
+ steps :
43
+ - task : UsePythonVersion@0
44
+ inputs :
45
+ versionSpec : ' 3.9'
35
46
- bash : |
36
- set -ex
37
- if [[ "$COMMIT_MESSAGE" =~ "[lint skip]" ]]; then
38
- # skip linting
39
- echo "Skipping flake8 linting"
40
- exit 0
41
- else
42
- ./build_tools/circle/linting.sh
43
- fi
47
+ pip install flake8 mypy==0.782
48
+ displayName: Install linters
49
+ - bash : |
50
+ ./build_tools/circle/linting.sh
44
51
displayName: Run linting
45
52
- bash : |
46
- set -ex
47
- if [[ "$COMMIT_MESSAGE" =~ "[lint skip]" ]]; then
48
- # skip linting
49
- echo "Skipping mypy linting"
50
- exit 0
51
- else
52
- mypy sklearn/
53
- fi
53
+ mypy sklearn/
54
54
displayName: Run mypy
55
- - bash : |
56
- if [[ "$COMMIT_MESSAGE" =~ "[scipy-dev]" ]] || [[ $BUILD_REASON == "Schedule" ]]; then
57
- echo "Running scipy-dev"
58
- echo "##vso[task.setvariable variable=runScipyDev;isOutput=true]true"
59
- else
60
- echo "##vso[task.setvariable variable=runScipyDev;isOutput=true]false"
61
- fi
62
- name: gitCommitMessage
63
- displayName: Determine to run scipy-dev
64
55
65
56
- template : build_tools/azure/posix.yml
66
57
parameters :
67
58
name : Linux_Nightly
68
59
vmImage : ubuntu-18.04
69
- dependsOn : [linting]
70
- condition : eq(dependencies['linting']['outputs']['gitCommitMessage.runScipyDev'], 'true')
60
+ dependsOn : [git_commit, linting]
61
+ condition : |
62
+ and(
63
+ succeeded(),
64
+ not(contains(dependencies['git_commit']['outputs']['commit.message'], '[ci skip]')),
65
+ or(eq(variables['Build.Reason'], 'Schedule'),
66
+ contains(dependencies['git_commit']['outputs']['commit.message'], '[scipy-dev]'
67
+ )
68
+ )
69
+ )
71
70
matrix :
72
71
pylatest_pip_scipy_dev :
73
72
DISTRIB : ' conda-pip-scipy-dev'
84
83
parameters :
85
84
name : Linux_Runs
86
85
vmImage : ubuntu-18.04
86
+ dependsOn : [git_commit]
87
+ condition : |
88
+ and(
89
+ succeeded(),
90
+ not(contains(dependencies['git_commit']['outputs']['commit.message'], '[ci skip]'))
91
+ )
87
92
matrix :
88
93
pylatest_conda_mkl :
89
94
DISTRIB : ' conda'
@@ -95,8 +100,13 @@ jobs:
95
100
parameters :
96
101
name : Linux
97
102
vmImage : ubuntu-18.04
98
- dependsOn : [linting]
99
- condition : and(ne(variables['Build.Reason'], 'Schedule'), succeeded('linting'))
103
+ dependsOn : [linting, git_commit]
104
+ condition : |
105
+ and(
106
+ succeeded(),
107
+ not(contains(dependencies['git_commit']['outputs']['commit.message'], '[ci skip]')),
108
+ ne(variables['Build.Reason'], 'Schedule')
109
+ )
100
110
matrix :
101
111
# Linux environment to test that scikit-learn can be built against
102
112
# versions of numpy, scipy with ATLAS that comes with Ubuntu Bionic 18.04
@@ -139,8 +149,13 @@ jobs:
139
149
parameters :
140
150
name : Linux32
141
151
vmImage : ubuntu-18.04
142
- dependsOn : [linting]
143
- condition : and(ne(variables['Build.Reason'], 'Schedule'), succeeded('linting'))
152
+ dependsOn : [linting, git_commit]
153
+ condition : |
154
+ and(
155
+ succeeded(),
156
+ not(contains(dependencies['git_commit']['outputs']['commit.message'], '[ci skip]')),
157
+ ne(variables['Build.Reason'], 'Schedule')
158
+ )
144
159
matrix :
145
160
py36_ubuntu_atlas_32bit :
146
161
DISTRIB : ' ubuntu-32'
@@ -157,8 +172,13 @@ jobs:
157
172
parameters :
158
173
name : macOS
159
174
vmImage : macOS-10.14
160
- dependsOn : [linting]
161
- condition : and(ne(variables['Build.Reason'], 'Schedule'), succeeded('linting'))
175
+ dependsOn : [linting, git_commit]
176
+ condition : |
177
+ and(
178
+ succeeded(),
179
+ not(contains(dependencies['git_commit']['outputs']['commit.message'], '[ci skip]')),
180
+ ne(variables['Build.Reason'], 'Schedule')
181
+ )
162
182
matrix :
163
183
pylatest_conda_forge_mkl :
164
184
DISTRIB : ' conda'
@@ -174,8 +194,13 @@ jobs:
174
194
parameters :
175
195
name : Windows
176
196
vmImage : vs2017-win2016
177
- dependsOn : [linting]
178
- condition : and(ne(variables['Build.Reason'], 'Schedule'), succeeded('linting'))
197
+ dependsOn : [linting, git_commit]
198
+ condition : |
199
+ and(
200
+ succeeded(),
201
+ not(contains(dependencies['git_commit']['outputs']['commit.message'], '[ci skip]')),
202
+ ne(variables['Build.Reason'], 'Schedule')
203
+ )
179
204
matrix :
180
205
py37_conda_mkl :
181
206
PYTHON_VERSION : ' 3.7'
0 commit comments