forked from dotnet/roslyn
-
Notifications
You must be signed in to change notification settings - Fork 0
/
azure-pipelines.yml
533 lines (476 loc) · 19.8 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
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
# Branches that trigger a build on commit
trigger:
- main
- main-vs-deps
- release/*
- features/*
- demos/*
# Branches that trigger builds on PR
pr:
branches:
include:
- main
- main-vs-deps
- release/*
- features/*
- demos/*
paths:
exclude:
- docs/*
- eng/config/PublishData.json
- src/Features/LanguageServer/Microsoft.CommonLanguageServerProtocol.Framework/README.md
- .vscode/*
- .github/*
- .devcontainer/*
- .git-blame-ignore-revs
- .vsconfig
- CODE-OF-CONDUCT.md
- CONTRIBUTING.md
- README.md
variables:
# This value is conditionally overriden by the variable group DotNet-HelixApi-Access.
# ADO only lets us conditionally include a variable group on individual stages.
- name: HelixApiAccessToken
value: ''
- name: Codeql.Enabled
value: false
- name: Codeql.SkipTaskAutoInjection
value: true
# Set pool / queue name variables depending on which instance we're running in.
- name: PoolName
${{ if eq(variables['System.TeamProject'], 'public') }}:
value: NetCore-Public
${{ else }}:
value: NetCore1ESPool-Internal
- name: Vs2022PreviewQueueName
${{ if eq(variables['System.TeamProject'], 'public') }}:
value: windows.vs2022preview.amd64.open
${{ else }}:
value: windows.vs2022preview.amd64
- name: UbuntuQueueName
${{ if eq(variables['System.TeamProject'], 'public') }}:
value: Build.Ubuntu.2004.Amd64.Open
${{ else }}:
value: Build.Ubuntu.2004.Amd64
- name: WindowsQueueName
${{ if eq(variables['System.TeamProject'], 'public') }}:
value: 1es-windows-2022-open
${{ else }}:
value: 1es-windows-2022
- name: HelixWindowsQueueName
${{ if eq(variables['System.TeamProject'], 'public') }}:
value: Windows.10.Amd64.Open
${{ else }}:
value: Windows.10.Amd64
- name: HelixWindowsSpanishQueueName
${{ if eq(variables['System.TeamProject'], 'public') }}:
value: Windows.10.Amd64.Server2022.ES.Open
${{ else }}:
value: Windows.10.Amd64.Server2022.ES
- name: HelixUbuntuQueueName
${{ if eq(variables['System.TeamProject'], 'public') }}:
value: Ubuntu.2004.Amd64.Open
${{ else }}:
value: Ubuntu.2004.Amd64
- name: HelixMacOsQueueName
${{ if eq(variables['System.TeamProject'], 'public') }}:
value: OSX.13.Amd64.Open
${{ else }}:
value: OSX.13.Amd64
parameters:
# These pools allow us to configure the pools once for multiple jobs.
# We have to use parameters here as these are object typed.
- name: ubuntuPool
type: object
default:
name: $(PoolName)
demands: ImageOverride -equals $(UbuntuQueueName)
- name: windowsPool
type: object
default:
name: $(PoolName)
demands: ImageOverride -equals $(WindowsQueueName)
- name: vs2022PreviewPool
type: object
default:
name: $(PoolName)
demands: ImageOverride -equals $(Vs2022PreviewQueueName)
stages:
- stage: Windows_Debug_Build
dependsOn: []
jobs:
- template: eng/pipelines/build-windows-job.yml
parameters:
jobName: Build_Windows_Debug
testArtifactName: Transport_Artifacts_Windows_Debug
configuration: Debug
poolParameters: ${{ parameters.vs2022PreviewPool }}
restoreArguments: -msbuildEngine dotnet /p:UsingToolVSSDK=false /p:GenerateSatelliteAssemblies=false
buildArguments: -msbuildEngine dotnet /p:UsingToolVSSDK=false /p:GenerateSatelliteAssemblies=false /p:PublishReadyToRun=false
- stage: Windows_Release_Build
dependsOn: []
jobs:
- template: eng/pipelines/build-windows-job.yml
parameters:
jobName: Build_Windows_Release
testArtifactName: Transport_Artifacts_Windows_Release
configuration: Release
poolParameters: ${{ parameters.vs2022PreviewPool }}
restoreArguments: -msbuildEngine dotnet /p:UsingToolVSSDK=false /p:GenerateSatelliteAssemblies=false
buildArguments: -msbuildEngine dotnet /p:UsingToolVSSDK=false /p:GenerateSatelliteAssemblies=false /p:PublishReadyToRun=false
- stage: Unix_Build
dependsOn: []
jobs:
- template: eng/pipelines/build-unix-job.yml
parameters:
jobName: Build_Unix_Debug
testArtifactName: Transport_Artifacts_Unix_Debug
poolParameters: ${{ parameters.ubuntuPool }}
- stage: Source_Build
dependsOn: []
jobs:
# Like template `eng/common/templates/jobs/source-build.yml`
- job: Source_Build_Managed
displayName: Source-Build (Managed)
container: mcr.microsoft.com/dotnet-buildtools/prereqs:centos-stream9
pool:
${{ if eq(variables['System.TeamProject'], 'public') }}:
name: $[replace(replace(eq(contains(coalesce(variables['System.PullRequest.TargetBranch'], variables['Build.SourceBranch'], 'refs/heads/main'), 'release'), 'true'), True, 'NetCore-Svc-Public' ), False, 'NetCore-Public')]
demands: ImageOverride -equals Build.Ubuntu.2204.Amd64.Open
${{ if eq(variables['System.TeamProject'], 'internal') }}:
name: $[replace(replace(eq(contains(coalesce(variables['System.PullRequest.TargetBranch'], variables['Build.SourceBranch'], 'refs/heads/main'), 'release'), 'true'), True, 'NetCore1ESPool-Svc-Internal'), False, 'NetCore1ESPool-Internal')]
demands: ImageOverride -equals Build.Ubuntu.2204.Amd64
workspace:
clean: all
steps:
- template: /eng/common/templates/steps/source-build.yml
parameters:
platform:
name: 'Managed'
container: 'mcr.microsoft.com/dotnet-buildtools/prereqs:centos-stream9'
- stage: Windows_Debug_Desktop
dependsOn: Windows_Debug_Build
variables:
- ${{ if ne(variables['System.TeamProject'], 'public') }}:
- group: DotNet-HelixApi-Access
jobs:
- ${{ if ne(variables['Build.Reason'], 'PullRequest') }}:
- template: eng/pipelines/test-windows-job.yml
parameters:
testRunName: 'Test Windows Desktop Debug 32'
jobName: Test_Windows_Desktop_Debug_32
testArtifactName: Transport_Artifacts_Windows_Debug
configuration: Debug
testArguments: -testDesktop -testArch x86
helixQueueName: $(HelixWindowsQueueName)
helixApiAccessToken: $(HelixApiAccessToken)
poolParameters: ${{ parameters.windowsPool }}
- template: eng/pipelines/test-windows-job.yml
parameters:
testRunName: 'Test Windows Desktop Debug 64'
jobName: Test_Windows_Desktop_Debug_64
testArtifactName: Transport_Artifacts_Windows_Debug
configuration: Debug
testArguments: -testDesktop -testArch x64
helixQueueName: $(HelixWindowsQueueName)
helixApiAccessToken: $(HelixApiAccessToken)
poolParameters: ${{ parameters.windowsPool }}
- stage: Windows_Release_Desktop
dependsOn: Windows_Release_Build
variables:
- ${{ if ne(variables['System.TeamProject'], 'public') }}:
- group: DotNet-HelixApi-Access
jobs:
- template: eng/pipelines/test-windows-job.yml
parameters:
testRunName: 'Test Windows Desktop Release 32'
jobName: Test_Windows_Desktop_Release_32
testArtifactName: Transport_Artifacts_Windows_Release
configuration: Release
testArguments: -testDesktop -testArch x86
helixQueueName: $(HelixWindowsQueueName)
helixApiAccessToken: $(HelixApiAccessToken)
poolParameters: ${{ parameters.windowsPool }}
- ${{ if ne(variables['Build.Reason'], 'PullRequest') }}:
- template: eng/pipelines/test-windows-job.yml
parameters:
testRunName: 'Test Windows Desktop Release 64'
jobName: Test_Windows_Desktop_Release_64
testArtifactName: Transport_Artifacts_Windows_Release
configuration: Release
testArguments: -testDesktop -testArch x64
helixQueueName: $(HelixWindowsQueueName)
helixApiAccessToken: $(HelixApiAccessToken)
poolParameters: ${{ parameters.windowsPool }}
- template: eng/pipelines/test-windows-job.yml
parameters:
testRunName: 'Test Windows Desktop Spanish Release 64'
jobName: Test_Windows_Desktop_Spanish_Release_64
testArtifactName: Transport_Artifacts_Windows_Release
configuration: Release
testArguments: -testDesktop -testArch x64
helixQueueName: $(HelixWindowsSpanishQueueName)
helixApiAccessToken: $(HelixApiAccessToken)
poolParameters: ${{ parameters.windowsPool }}
- stage: Windows_Debug_CoreClr
dependsOn: Windows_Debug_Build
variables:
- ${{ if ne(variables['System.TeamProject'], 'public') }}:
- group: DotNet-HelixApi-Access
jobs:
- template: eng/pipelines/test-windows-job.yml
parameters:
testRunName: 'Test Windows CoreClr Debug'
jobName: Test_Windows_CoreClr_Debug
testArtifactName: Transport_Artifacts_Windows_Debug
configuration: Debug
testArguments: -testCoreClr
helixQueueName: $(HelixWindowsQueueName)
helixApiAccessToken: $(HelixApiAccessToken)
poolParameters: ${{ parameters.windowsPool }}
- ${{ if ne(variables['Build.Reason'], 'PullRequest') }}:
- template: eng/pipelines/test-windows-job.yml
parameters:
testRunName: 'Test Windows CoreClr Debug Spanish'
jobName: Test_Windows_CoreClr_Debug_Spanish
testArtifactName: Transport_Artifacts_Windows_Debug
configuration: Debug
testArguments: -testCoreClr
helixQueueName: $(HelixWindowsSpanishQueueName)
helixApiAccessToken: $(HelixApiAccessToken)
poolParameters: ${{ parameters.windowsPool }}
- ${{ if ne(variables['Build.Reason'], 'PullRequest') }}:
- template: eng/pipelines/test-windows-job-single-machine.yml
parameters:
testRunName: 'Test Windows CoreClr Debug Single Machine'
jobName: Test_Windows_CoreClr_Debug_Single_Machine
testArtifactName: Transport_Artifacts_Windows_Debug
configuration: Debug
poolParameters: ${{ parameters.vs2022PreviewPool }}
testArguments: -testCoreClr
- template: eng/pipelines/test-windows-job.yml
parameters:
testRunName: 'Test Windows CoreCLR IOperation Debug'
jobName: Test_Windows_CoreClr_IOperation_Debug
testArtifactName: Transport_Artifacts_Windows_Debug
configuration: Debug
testArguments: -testCoreClr -testIOperation -testCompilerOnly
helixQueueName: $(HelixWindowsQueueName)
helixApiAccessToken: $(HelixApiAccessToken)
poolParameters: ${{ parameters.windowsPool }}
# This leg runs almost all the compiler tests supported on CoreCLR, but
# with additional validation for used assemblies and GetEmitDiagnostics
- template: eng/pipelines/test-windows-job.yml
parameters:
testRunName: 'Test Windows CoreCLR UsedAssemblies Debug'
jobName: Test_Windows_CoreClr_UsedAssemblies_Debug
testArtifactName: Transport_Artifacts_Windows_Debug
configuration: Debug
testArguments: -testCoreClr -testUsedAssemblies -testCompilerOnly
helixQueueName: $(HelixWindowsQueueName)
helixApiAccessToken: $(HelixApiAccessToken)
poolParameters: ${{ parameters.windowsPool }}
- stage: Windows_Release_CoreClr
dependsOn: Windows_Release_Build
variables:
- ${{ if ne(variables['System.TeamProject'], 'public') }}:
- group: DotNet-HelixApi-Access
jobs:
- template: eng/pipelines/test-windows-job.yml
parameters:
testRunName: 'Test Windows CoreClr Release'
jobName: Test_Windows_CoreClr_Release
testArtifactName: Transport_Artifacts_Windows_Release
configuration: Release
testArguments: -testCoreClr
helixQueueName: $(HelixWindowsQueueName)
helixApiAccessToken: $(HelixApiAccessToken)
poolParameters: ${{ parameters.windowsPool }}
- stage: Unix_Debug_CoreClr
dependsOn: Unix_Build
variables:
- ${{ if ne(variables['System.TeamProject'], 'public') }}:
- group: DotNet-HelixApi-Access
jobs:
- template: eng/pipelines/test-unix-job.yml
parameters:
testRunName: 'Test Linux Debug'
jobName: Test_Linux_Debug
testArtifactName: Transport_Artifacts_Unix_Debug
configuration: Debug
testArguments: --testCoreClr
helixQueueName: $(HelixUbuntuQueueName)
helixApiAccessToken: $(HelixApiAccessToken)
poolParameters: ${{ parameters.ubuntuPool }}
- ${{ if ne(variables['Build.Reason'], 'PullRequest') }}:
- template: eng/pipelines/test-unix-job-single-machine.yml
parameters:
testRunName: 'Test Linux Debug Single Machine'
jobName: Test_Linux_Debug_Single_Machine
testArtifactName: Transport_Artifacts_Unix_Debug
configuration: Debug
testArguments: --testCoreClr
poolParameters: ${{ parameters.ubuntuPool }}
# https://github.com/dotnet/runtime/issues/97186
# Disabled until runtime can track down the crash
- ${{ if ne(variables['Build.Reason'], 'PullRequest') }}:
- template: eng/pipelines/test-unix-job.yml
parameters:
testRunName: 'Test macOS Debug'
jobName: Test_macOS_Debug
testArtifactName: Transport_Artifacts_Unix_Debug
configuration: Debug
testArguments: --testCoreClr
helixQueueName: $(HelixMacOsQueueName)
helixApiAccessToken: $(HelixApiAccessToken)
poolParameters: ${{ parameters.ubuntuPool }}
- stage: Correctness
dependsOn: []
jobs:
- template: eng/pipelines/evaluate-changed-files.yml
parameters:
jobName: Determine_Changes
poolParameters: ${{ parameters.ubuntuPool }}
paths:
- subset: compilers
include:
- src/Compilers/*
- src/Dependencies/*
- src/NuGet/Microsoft.Net.Compilers.Toolset/*
- eng/*
- src/Tools/Source/CompilerGeneratorTools/*
- job: Correctness_Build_Artifacts
dependsOn: Determine_Changes
pool: ${{ parameters.vs2022PreviewPool }}
timeoutInMinutes: 90
variables:
- template: eng/pipelines/variables-build.yml
parameters:
configuration: Release
- name: compilerChange
value: $[dependencies.Determine_Changes.outputs['SetPathVars_compilers.containsChange']]
steps:
- template: eng/pipelines/checkout-windows-task.yml
- powershell: eng/build.ps1 -configuration Release -prepareMachine -ci -restore -binaryLogName Restore.binlog
displayName: Restore
- powershell: eng/build.ps1 -configuration Release -prepareMachine -ci -build -pack -publish -sign -binaryLogName Build.binlog /p:DotnetPublishUsingPipelines=true
displayName: Build
- task: PowerShell@2
displayName: Publish Symbols Dry-Run
inputs:
filePath: eng\common\sdk-task.ps1
arguments: -task PublishToSymbolServers /p:DryRun="true" -restore -msbuildEngine dotnet
/p:DotNetSymbolServerTokenMsdl=DryRunPTA
/p:DotNetSymbolServerTokenSymWeb=DryRunPTA
/p:PDBArtifactsDirectory='$(Build.ArtifactStagingDirectory)/PDBArtifacts/'
/p:BlobBasePath='$(Build.SourcesDirectory)/artifacts/tmp/Release/SymbolPackages/'
/p:SymbolPublishingExclusionsFile='$(Build.SourcesDirectory)/eng/SymbolPublishingExclusionsFile.txt'
/p:Configuration=Release
/p:PublishToMSDL=false
- script: $(Build.SourcesDirectory)\artifacts\bin\BuildBoss\Release\net472\BuildBoss.exe -r "$(Build.SourcesDirectory)/" -c Release -p Roslyn.sln
displayName: Validate Build Artifacts
- powershell: eng/validate-rules-missing-documentation.ps1 -ci
displayName: Validate rules missing documentation
- powershell: eng/generate-compiler-code.ps1 -test -configuration Release
displayName: Generate Syntax Files
- powershell: eng/validate-code-formatting.ps1 -ci -rootDirectory $(Build.SourcesDirectory)\src -includeDirectories Compilers\CSharp\Portable\Generated\, Compilers\VisualBasic\Portable\Generated\, ExpressionEvaluator\VisualBasic\Source\ResultProvider\Generated\
displayName: Validate Generated Syntax Files
condition: or(ne(variables['Build.Reason'], 'PullRequest'), eq(variables['compilerChange'], 'true'))
- template: eng/pipelines/publish-logs.yml
parameters:
jobName: Correctness_Build_Artifacts
configuration: Release
- job: Correctness_Determinism
dependsOn: Determine_Changes
condition: or(ne(variables['Build.Reason'], 'PullRequest'), eq(dependencies.Determine_Changes.outputs['SetPathVars_compilers.containsChange'], 'true'))
pool: ${{ parameters.vs2022PreviewPool }}
timeoutInMinutes: 90
variables:
- template: eng/pipelines/variables-build.yml
parameters:
configuration: Debug
- name: bootstrapDir
value: $(Build.SourcesDirectory)/artifacts/bootstrap/determinism
steps:
- template: eng/pipelines/checkout-windows-task.yml
- powershell: eng/make-bootstrap.ps1 -output $(bootstrapDir) -ci
displayName: Build Bootstrap Compiler
- powershell: eng/test-determinism.ps1 -configuration Debug -bootstrapDir $(bootstrapDir) -ci
displayName: Build - Validate determinism
- template: eng/pipelines/publish-logs.yml
parameters:
jobName: Correctness_Determinism
configuration: Debug
- job: Correctness_Bootstrap_Build_Default
dependsOn: Determine_Changes
condition: or(ne(variables['Build.Reason'], 'PullRequest'), eq(dependencies.Determine_Changes.outputs['SetPathVars_compilers.containsChange'], 'true'))
pool: ${{ parameters.vs2022PreviewPool }}
timeoutInMinutes: 90
variables:
- template: eng/pipelines/variables-build.yml
parameters:
configuration: Release
steps:
- template: eng/pipelines/build-bootstrap.yml
parameters:
toolset: Default
- job: Correctness_Bootstrap_Build_Framework
dependsOn: Determine_Changes
condition: ne(variables['Build.Reason'], 'PullRequest')
pool: ${{ parameters.vs2022PreviewPool }}
timeoutInMinutes: 90
variables:
- template: eng/pipelines/variables-build.yml
parameters:
configuration: Release
steps:
- template: eng/pipelines/build-bootstrap.yml
parameters:
toolset: Framework
- job: Correctness_TodoCheck
pool: ${{ parameters.ubuntuPool }}
timeoutInMinutes: 10
steps:
- template: eng/pipelines/checkout-unix-task.yml
- powershell: eng/todo-check.ps1
displayName: Validate TODO/PROTOTYPE comments are not present
- job: Correctness_Rebuild
dependsOn: Determine_Changes
condition: or(ne(variables['Build.Reason'], 'PullRequest'), eq(dependencies.Determine_Changes.outputs['SetPathVars_compilers.containsChange'], 'true'))
pool: ${{ parameters.vs2022PreviewPool }}
timeoutInMinutes: 90
variables:
- template: eng/pipelines/variables-build.yml
parameters:
configuration: Release
steps:
- template: eng/pipelines/checkout-windows-task.yml
- script: .\eng\test-rebuild.cmd -ci -configuration Release -bootstrap
displayName: Run BuildValidator
- task: PublishBuildArtifacts@1
displayName: Publish BuildValidator debug outputs
inputs:
PathtoPublish: '$(Build.SourcesDirectory)/artifacts/BuildValidator'
ArtifactName: 'BuildValidator_DebugOut'
publishLocation: Container
continueOnError: true
condition: failed()
- template: eng/pipelines/publish-logs.yml
parameters:
jobName: Correctness_Rebuild
configuration: Release
- job: Correctness_Analyzers
pool: ${{ parameters.ubuntuPool }}
timeoutInMinutes: 35
variables:
- template: eng/pipelines/variables-build.yml
parameters:
configuration: Debug
steps:
- template: eng/pipelines/checkout-unix-task.yml
- script: ./eng/build.sh --solution Roslyn.sln --restore --build --configuration Debug --prepareMachine --ci --binaryLog --runanalyzers --warnaserror /p:RoslynEnforceCodeStyle=true
displayName: Build with analyzers
- template: eng/pipelines/publish-logs.yml
parameters:
jobName: Correctness_Analyzers
configuration: Debug