forked from microsoft/azure-pipelines-tasks
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.vsts-ci.yml
305 lines (249 loc) · 8.71 KB
/
.vsts-ci.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
phases:
# TODO: Leverage step re-use to eliminate redundancy
################################################################################
- phase: buildAll_windows
################################################################################
displayName: Build all tasks (Windows)
condition: and(succeeded(), not(variables.task), eq(variables.os, 'Windows_NT'))
queue:
name: Hosted VS2017
parallel: $[ variables.build_windows_parallel ]
steps:
# Clean
- checkout: self
clean: true
# Start collect diagnostics
- powershell: .\ci\start-collect-diagnostics.ps1
displayName: Start collect diagnostics
condition: and(succeeded(), eq(variables.collect_diagnostics, 'true'))
# Use node 8, npm 5
- task: NodeTool@0
displayName: Use node 8
inputs:
versionSpec: "8.x"
# npm install
- script: npm install
displayName: npm install
# Slice the tasks (sets TASK_PATTERN)
- script: node .\ci\set-task-slice.js
displayName: Set task slice
# Build
- script: node make.js build --task "$(task_pattern)"
displayName: Build
# Stage slice
- script: node .\ci\stage-slice.js
displayName: Stage slice
condition: and(succeeded(), ne(variables['build.reason'], 'PullRequest'))
# Publish slice artifact
- task: PublishBuildArtifacts@1
displayName: Publish slice artifact
condition: and(succeeded(), ne(variables['build.reason'], 'PullRequest'))
inputs:
pathToPublish: _package/tasks.zip
artifactName: slice-$(system.jobPositionInPhase)
artifactType: container
# Test
- script: node make.js test
displayName: Test with node 6
- script: node make.js testLegacy --task "$(task_pattern)"
displayName: Legacy tests with node 6
# Test
- script: node make.js test --node 5 --runner ts
displayName: Test with node 5
- script: node make.js testLegacy --node 5 --runner ts --task "$(task_pattern)"
displayName: Legacy tests with node 5
# Stop collect diagnostics
- powershell: .\ci\stop-collect-diagnostics.ps1
displayName: Stop collect diagnostics
condition: and(always(), eq(variables.collect_diagnostics, 'true'))
################################################################################
- phase: publish_windows
################################################################################
displayName: Publish
dependsOn: buildAll_windows # TODO: also depend on buildAll_darwin buildAll_linux
condition: and(succeeded(), ne(variables['build.reason'], 'PullRequest'))
queue: Hosted VS2017
steps:
# Clean
- checkout: self
clean: true
# Use node 8, npm 5
- task: NodeTool@0
displayName: Use node 8
inputs:
versionSpec: "8.x"
# Use NuGet 4
- task: NuGetToolInstaller@0
displayName: Use NuGet 4
inputs:
versionSpec: 4.0.0
# npm install
- script: npm install
displayName: npm install
# Set variables
- powershell: .\ci\set-publish-variables.ps1
displayName: Set publish variables
# Download slices
- powershell: .\ci\download-slices.ps1
displayName: Download slices
env:
SYSTEM_ACCESSTOKEN: $(system.accessToken)
# Stage milestone
- script: node .\ci\stage-milestone.js
displayName: Stage milestone
# Create packages.config for restoring previous milestones
- script: node .\ci\create-restore-config.js
displayName: Create packages.config for restoring previous milestones
# Restore previous milestones
- task: NuGetCommand@2
displayName: Restore previous milestones
inputs:
command: restore
solution: _package\packages.config
selectOrConfig: select
feedRestore: $(task_milestone_feed_name)
includeNuGetOrg: false
packagesDirectory: $(system.defaultWorkingDirectory)\_package\restore
# Stage aggregate
- script: node .\ci\stage-aggregate.js
displayName: Stage aggregate
# Publish aggregate artifact
- task: PublishBuildArtifacts@1
inputs:
pathToPublish: _package/publish-layout
artifactName: TaskPackage
artifactType: container
# Publish milestone package
- task: NuGetCommand@2
displayName: Publish milestone package
condition: and(succeeded(), variables.publish_milestone)
inputs:
command: push
searchPatternPush: _package\vsts-tasks-milestone.$(milestone_version).nupkg
nuGetFeedType: internal
feedPublish: $(task_milestone_feed_name)
# Update build number
- script: "echo ##vso[build.updatebuildnumber]$(aggregate_version)"
displayName: Update build number
################################################################################
- phase: buildSingle
################################################################################
displayName: Build single task
condition: and(succeeded(), variables.task)
steps:
# Clean
- checkout: self
clean: true
# Start collect diagnostics
- powershell: .\ci\start-collect-diagnostics.ps1
displayName: Start collect diagnostics
condition: and(succeeded(), eq(variables.collect_diagnostics, 'true'), eq(variables['agent.os'], 'Windows_NT'))
# Use node 8, npm 5
- task: NodeTool@0
displayName: Use node 8
inputs:
versionSpec: "8.x"
# npm install
- script: npm install
displayName: npm install
# Build
- script: node make.js build --task "$(task)"
displayName: Build
# Stage hotfix
- script: node ./ci/stage-hotfix.js
condition: and(succeeded(), eq(variables['agent.os'], 'Windows_NT'))
displayName: Stage hotfix
# Publish hotfix artifact
- task: PublishBuildArtifacts@1
displayName: Publish hotfix artifact
condition: and(succeeded(), eq(variables['agent.os'], 'Windows_NT'))
inputs:
pathToPublish: _package/hotfix-layout
artifactName: hotfix
artifactType: container
# Test
- script: node make.js test
displayName: Test with node 6
- script: node make.js testLegacy --task "$(task)"
displayName: Legacy tests with node 6
# Test
- script: node make.js test --node 5 --runner ts
displayName: Test with node 5
- script: node make.js testLegacy --node 5 --runner ts --task "$(task)"
displayName: Legacy tests with node 5
# Stop collect diagnostics
- powershell: .\ci\stop-collect-diagnostics.ps1
displayName: Stop collect diagnostics
condition: and(always(), eq(variables.collect_diagnostics, 'true'), eq(variables['agent.os'], 'Windows_NT'))
################################################################################
- phase: buildAll_linux
################################################################################
displayName: Build all tasks (Linux)
condition: and(succeeded(), not(variables.task), eq(variables.os, 'Linux'))
queue:
name: Hosted Linux Preview
parallel: $[ variables.build_linux_parallel ]
steps:
# Clean
- checkout: self
clean: true
# Use node 8, npm 5
- task: NodeTool@0
displayName: Use node 8
inputs:
versionSpec: "8.x"
# npm install
- script: npm install
displayName: npm install
# Slice the tasks (sets TASK_PATTERN)
- script: node ./ci/set-task-slice.js
displayName: Set task slice
# Build
- script: node make.js build --task "$(task_pattern)"
displayName: Build
# Test
- script: node make.js test --runner ts
displayName: Test with node 6
- script: node make.js testLegacy --runner ts --task "$(task_pattern)"
displayName: Legacy tests with node 6
# Test
- script: node make.js test --node 5
displayName: Test with node 5
- script: node make.js testLegacy --node 5 --task "$(task_pattern)"
displayName: Legacy tests with node 5
################################################################################
- phase: buildAll_darwin
################################################################################
displayName: Build all tasks (macOS)
condition: and(succeeded(), not(variables.task), eq(variables.os, 'Darwin'))
queue:
name: Hosted macOS Preview
parallel: $[ variables.build_darwin_parallel ]
steps:
# Clean
- checkout: self
clean: true
# Use node 8, npm 5
- task: NodeTool@0
displayName: Use node 8
inputs:
versionSpec: "8.x"
# npm install
- script: npm install
displayName: npm install
# Slice the tasks (sets TASK_PATTERN)
- script: node ./ci/set-task-slice.js
displayName: Set task slice
# Build
- script: node make.js build --task "$(task_pattern)"
displayName: Build
# Test
- script: node make.js test --runner ts
displayName: Test with node 6
- script: node make.js testLegacy --runner ts --task "$(task_pattern)"
displayName: Legacy tests with node 6
# Test with node 5
- script: node make.js test --node 5
displayName: Test with node 5
- script: node make.js testLegacy --node 5 --task "$(task_pattern)"
displayName: Legacy tests with node 5