-
Notifications
You must be signed in to change notification settings - Fork 10.1k
/
default-build.yml
532 lines (503 loc) · 24.9 KB
/
default-build.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
# default-build.yml
# Description: Defines a build phase for invoking build.sh/cmd
# Parameters:
# jobName: string
# The name of the job. Defaults to the name of the OS. No spaces allowed
# jobDisplayName: string
# The friendly job name to display in the UI. Defaults to the name of the OS.
# agentOs: string
# Used in templates to define variables which are OS specific. Typically from the set { Windows, Linux, macOS }
# buildArgs: string
# Additional arguments to pass to the build.sh/cmd script.
# Note: -ci is always passed
# beforeBuild: [steps]
# Additional steps to run before build.sh/cmd
# steps: [steps]
# Instead of running build.cmd/sh, run these build steps.
# afterBuild: [steps]
# Additional steps to run after build.sh/cmd
# artifacts: [array]
# name: string
# The name of the artifact container
# - path: string
# The file path to artifacts output
# includeForks: boolean
# Should artifacts from forks be published?
# publishOnError: boolean
# Should artifacts be published if previous step failed?
# dependsOn: string | [ string ]
# For fan-out/fan-in. https://learn.microsoft.com/azure/devops/pipelines/yaml-schema?view=azure-devops&tabs=schema#job
# condition: string
# A condition which can be used to skip the job completely
# codeSign: boolean
# This build definition is enabled for code signing. (Only applies to Windows)
# buildDirectory: string
# Specifies what directory to run build.sh/cmd
# isAzDOTestingJob: boolean
# Determines if this job runs tests on the AzDO build agent. Controls some (currently Windows-only)
# installations and enables test publication (unless enablePublishTestResults is overridden).
# enablePublishTestResults: boolean
# Determines if test results should be published. Defaults to the isAzDOTestingJob setting.
# enableSbom: boolean
# Determines if an SBOM should be created. Defaults to true. Ignored in public builds.
# variables: [array]
# Job-specific variables. Defined using either name/value pairs or a variable list (using name or group syntax).
#
# See https://learn.microsoft.com/azure/devops/pipelines/yaml-schema for details
#
parameters:
# jobName: '' - use agentOs by default.
# jobDisplayName: '' - use agentOs by default.
agentOs: 'Windows'
buildArgs: ''
beforeBuild: []
# steps: [] don't define an empty object default because there is no way in template expression yet to check "if isEmpty(parameters.steps)"
afterBuild: []
artifacts: []
dependsOn: ''
condition: ''
codeSign: false
buildDirectory: $(System.DefaultWorkingDirectory)/eng/
isAzDOTestingJob: false
enablePublishTestResults: ''
enableSbom: true
variables: []
configuration: 'Release'
container: ''
enableRichCodeNavigation: ''
installNodeJs: true
timeoutInMinutes: 180
testRunTitle: $(AgentOsName)-$(BuildConfiguration)
useHostedUbuntu: true
# We need longer than the default amount of 5 minutes to upload our logs/artifacts. (We currently take around 5 mins in the best case).
# This makes sure we have time to upload everything in the case of a build timeout - really important for investigating a build
# timeout due to test hangs.
cancelTimeoutInMinutes: 15
jobs:
- ${{ if ne(variables['System.TeamProject'], 'internal') }}:
- template: /eng/common/templates/job/job.yml@self
parameters:
name: ${{ coalesce(parameters.jobName, parameters.agentOs) }}
displayName: ${{ coalesce(parameters.jobDisplayName, parameters.agentOs) }}
dependsOn: ${{ parameters.dependsOn }}
${{ if ne(parameters.condition, '') }}:
condition: ${{ parameters.condition }}
${{ if ne(parameters.enableRichCodeNavigation, '') }}:
enableRichCodeNavigation: true
richCodeNavigationLanguage: 'csharp,typescript,java'
timeoutInMinutes: ${{ parameters.timeoutInMinutes }}
cancelTimeoutInMinutes: ${{ parameters.cancelTimeoutInMinutes }}
${{ if and(eq(parameters.isAzDOTestingJob, true), ne(parameters.enablePublishTestResults, false)) }}:
enablePublishTestResults: true
testResultsFormat: xUnit # Have no vsTest results in any job.
mergeTestResults: true
testRunTitle: ${{ parameters.testRunTitle }}
enableSbom: ${{ parameters.enableSbom }}
enableTelemetry: true
helixRepo: dotnet/aspnetcore
helixType: build.product/
workspace:
clean: all
# Map friendly OS names to the right queue
# See https://github.com/dotnet/arcade/blob/master/Documentation/ChoosingAMachinePool.md
pool:
${{ if eq(parameters.agentOs, 'macOS') }}:
vmImage: macOS-12
${{ if eq(parameters.agentOs, 'Linux') }}:
${{ if eq(parameters.useHostedUbuntu, true) }}:
vmImage: ubuntu-20.04
${{ else }}:
name: $(DncEngPublicBuildPool)
demands: ImageOverride -equals Build.Ubuntu.2004.Amd64.Open
${{ if eq(parameters.agentOs, 'Windows') }}:
name: $(DncEngPublicBuildPool)
demands: ImageOverride -equals windows.vs2022preview.amd64.open
${{ if ne(parameters.container, '') }}:
container: ${{ parameters.container }}
${{ if ne(parameters.disableComponentGovernance, '') }}:
disableComponentGovernance: ${{ parameters.disableComponentGovernance }}
variables:
- AgentOsName: ${{ parameters.agentOs }}
- ASPNETCORE_TEST_LOG_MAXPATH: "200" # Keep test log file name length low enough for artifact zipping
- BuildScriptArgs: ${{ parameters.buildArgs }}
- _BuildConfig: ${{ parameters.configuration }}
- BuildConfiguration: ${{ parameters.configuration }}
- BuildDirectory: ${{ parameters.buildDirectory }}
- DOTNET_CLI_HOME: $(System.DefaultWorkingDirectory)
- DOTNET_SKIP_FIRST_TIME_EXPERIENCE: true
- TeamName: AspNetCore
- ${{ if ne(parameters.codeSign, true) }}:
- _SignType: ''
- LC_ALL: 'en_US.UTF-8'
- LANG: 'en_US.UTF-8'
- LANGUAGE: 'en_US.UTF-8'
# Log environment variables in binary logs to ease debugging
- MSBUILDLOGALLENVIRONMENTVARIABLES: true
# Rely on task Arcade injects, not auto-injected build step.
- skipComponentGovernanceDetection: true
- ${{ each variable in parameters.variables }}:
# handle a variable list using "name" and "value" properties
# example:
# - name: [key]
# value: [value]
- ${{ if ne(variable.name, '') }}:
- name: ${{ variable.name }}
value: ${{ variable.value }}
# handle variable groups
- ${{ if ne(variable.group, '') }}:
- group: ${{ variable.group }}
# handle name/value pairs (converting them into variable list entries)
# example:
# - [name]: [value]
- ${{ if and(eq(variable.name, ''), eq(variable.group, '')) }}:
- ${{ each pair in variable }}:
- name: ${{ pair.key }}
value: ${{ pair.value }}
steps:
- ${{ if ne(parameters.agentOs, 'Windows') }}:
- script: df -h
displayName: Disk size
- ${{ if eq(parameters.agentOs, 'macOS') }}:
- script: sudo xcode-select -s /Applications/Xcode_14.2.0.app/Contents/Developer
displayName: Use XCode 14.2.0
- checkout: self
clean: true
- ${{ if and(eq(parameters.agentOs, 'Windows'), eq(parameters.isAzDOTestingJob, true)) }}:
- powershell: ./eng/scripts/InstallProcDump.ps1
displayName: Install ProcDump
- powershell: ./eng/scripts/StartDumpCollectionForHangingBuilds.ps1 $(ProcDumpPath)procdump.exe artifacts/dumps/ (Get-Date).AddMinutes(160) dotnet
displayName: Start background dump collection
- ${{ if eq(parameters.installNodeJs, 'true') }}:
- task: NodeTool@0
displayName: Install Node 20.x
inputs:
versionSpec: 20.x
- ${{ if and(eq(parameters.agentOs, 'Windows'), eq(parameters.isAzDOTestingJob, true)) }}:
- powershell: |
Write-Host "##vso[task.setvariable variable=SeleniumProcessTrackingFolder]$(Build.SourcesDirectory)\artifacts\tmp\selenium\"
./eng/scripts/InstallGoogleChrome.ps1
displayName: Install Chrome
- ${{ if eq(parameters.agentOs, 'Windows') }}:
- powershell: Write-Host "##vso[task.prependpath]$(DOTNET_CLI_HOME)\.dotnet\tools"
displayName: Add dotnet tools to path
- ${{ if ne(parameters.agentOs, 'Windows') }}:
- script: echo "##vso[task.prependpath]$(DOTNET_CLI_HOME)/.dotnet/tools"
displayName: Add dotnet tools to path
- ${{ parameters.beforeBuild }}
# Add COMPlus_* environment variables to build steps.
- ${{ if ne(parameters.steps, '')}}:
- ${{ each step in parameters.steps }}:
# Include all properties e.g. `task: CmdLine@2` or `displayName: Build x64` _except_ a provided `env:`.
# Aim here is to avoid having two `env:` properties in the expanded YAML.
- ${{ each pair in step }}:
${{ if ne(pair.key, 'env') }}:
${{ pair.key }}: ${{ pair.value }}
env:
# Include the variables we always want.
COMPlus_DbgEnableMiniDump: 1
COMPlus_DbgMiniDumpName: "$(System.DefaultWorkingDirectory)/dotnet-%d.%t.core"
DotNetBuildsInternalReadSasToken: $(dotnetbuilds-internal-container-read-token)
# Expand provided `env:` properties, if any.
${{ if step.env }}:
${{ step.env }}
- ${{ if eq(parameters.steps, '')}}:
- ${{ if eq(parameters.agentOs, 'Windows') }}:
- script: $(BuildDirectory)\build.cmd -ci -prepareMachine -nativeToolsOnMachine -nobl -Configuration $(BuildConfiguration) $(BuildScriptArgs)
/p:DotNetSignType=$(_SignType)
displayName: Run build.cmd
env:
COMPlus_DbgEnableMiniDump: 1
COMPlus_DbgMiniDumpName: "$(System.DefaultWorkingDirectory)/dotnet-%d.%t.core"
DotNetBuildsInternalReadSasToken: $(dotnetbuilds-internal-container-read-token)
- ${{ if ne(parameters.agentOs, 'Windows') }}:
- script: $(BuildDirectory)/build.sh --ci --nobl --configuration $(BuildConfiguration) $(BuildScriptArgs)
displayName: Run build.sh
env:
COMPlus_DbgEnableMiniDump: 1
COMPlus_DbgMiniDumpName: "$(System.DefaultWorkingDirectory)/dotnet-%d.%t.core"
DotNetBuildsInternalReadSasToken: $(dotnetbuilds-internal-container-read-token)
- ${{ parameters.afterBuild }}
- ${{ if eq(parameters.agentOs, 'Linux') }}:
- script: df -h && du -h --threshold=50MB ..
displayName: Disk utilization
- ${{ if eq(parameters.agentOs, 'macOS') }}:
- script: df -h && du -h -d 3 ..
displayName: Disk utilization
- ${{ if and(eq(parameters.agentOs, 'Windows'), eq(parameters.isAzDOTestingJob, true)) }}:
- powershell: ./eng/scripts/FinishDumpCollectionForHangingBuilds.ps1 artifacts/dumps/
displayName: Finish background dump collection
continueOnError: true
condition: always()
- ${{ if eq(parameters.agentOs, 'Windows') }}:
- powershell: eng\scripts\KillProcesses.ps1
displayName: Kill processes
continueOnError: true
condition: always()
- ${{ if ne(parameters.agentOs, 'Windows') }}:
- script: eng/scripts/KillProcesses.sh
displayName: Kill processes
continueOnError: true
condition: always()
- ${{ each artifact in parameters.artifacts }}:
- task: PublishBuildArtifacts@1
displayName: Upload artifacts from ${{ artifact.path }}
condition: and(or(succeeded(), eq('${{ artifact.publishOnError }}', 'true')), or(eq(variables['system.pullrequest.isfork'], false), eq('${{ artifact.includeForks }}', 'true')))
continueOnError: true
inputs:
# Assume runtime variable values are absolute paths already.
${{ if startsWith(artifact.path, '$(') }}:
pathToPublish: ${{ artifact.path }}
${{ if not(startsWith(artifact.path, '$(')) }}:
pathToPublish: $(Build.SourcesDirectory)/${{ artifact.path }}
${{ if eq(artifact.name, '') }}:
artifactName: artifacts-$(AgentOsName)-$(BuildConfiguration)
${{ if ne(artifact.name, '') }}:
artifactName: ${{ artifact.name }}
artifactType: Container
parallel: true
- ${{ if eq(parameters.agentOs, 'Windows') }}:
- powershell: $(Build.SourcesDirectory)/eng/scripts/UploadCores.ps1 -ProcDumpOutputPath artifacts/dumps/
condition: failed()
displayName: Upload cores
- ${{ if ne(parameters.agentOs, 'Windows') }}:
- script: $(Build.SourcesDirectory)/eng/scripts/upload-cores.sh
condition: failed()
displayName: Upload cores
- ${{ if and(eq(parameters.isAzDOTestingJob, true), ne(parameters.enablePublishTestResults, false)) }}:
- task: PublishTestResults@2
displayName: Publish js test results
condition: always()
inputs:
testResultsFormat: JUnit
testResultsFiles: '**/artifacts/log/**/*.junit.xml'
testRunTitle: $(AgentOsName)-$(BuildConfiguration)-js
mergeTestResults: true
buildConfiguration: $(BuildConfiguration)
buildPlatform: $(AgentOsName)
- ${{ if eq(variables['System.TeamProject'], 'internal') }}:
- template: /eng/common/templates-official/job/job.yml@self
parameters:
name: ${{ coalesce(parameters.jobName, parameters.agentOs) }}
displayName: ${{ coalesce(parameters.jobDisplayName, parameters.agentOs) }}
dependsOn: ${{ parameters.dependsOn }}
${{ if ne(parameters.condition, '') }}:
condition: ${{ parameters.condition }}
${{ if ne(parameters.enableRichCodeNavigation, '') }}:
enableRichCodeNavigation: true
richCodeNavigationLanguage: 'csharp,typescript,java'
timeoutInMinutes: ${{ parameters.timeoutInMinutes }}
cancelTimeoutInMinutes: ${{ parameters.cancelTimeoutInMinutes }}
${{ if and(eq(parameters.agentOs, 'Windows'), eq(parameters.codeSign, 'true')) }}:
enableMicrobuild: true
enablePublishBuildAssets: true
enablePublishUsingPipelines: ${{ variables._PublishUsingPipelines }}
${{ if and(eq(parameters.isAzDOTestingJob, true), ne(parameters.enablePublishTestResults, false)) }}:
enablePublishTestResults: true
testResultsFormat: xUnit # Have no vsTest results in any job.
mergeTestResults: true
testRunTitle: ${{ parameters.testRunTitle }}
enableSbom: ${{ parameters.enableSbom }}
enableTelemetry: true
helixRepo: dotnet/aspnetcore
helixType: build.product/
workspace:
clean: all
# Map friendly OS names to the right queue
# See https://github.com/dotnet/arcade/blob/master/Documentation/ChoosingAMachinePool.md
pool:
${{ if eq(parameters.agentOs, 'macOS') }}:
name: Azure Pipelines
image: macOS-12
os: macOS
${{ if eq(parameters.agentOs, 'Linux') }}:
name: $(DncEngInternalBuildPool)
image: 1es-ubuntu-2004
os: linux
${{ if eq(parameters.agentOs, 'Windows') }}:
name: $(DncEngInternalBuildPool)
# Visual Studio Enterprise - contains some stuff, like SQL Server and IIS Express, that we use for testing
image: windows.vs2022preview.amd64
os: windows
${{ if ne(parameters.container, '') }}:
container: ${{ parameters.container }}
${{ if ne(parameters.disableComponentGovernance, '') }}:
disableComponentGovernance: ${{ parameters.disableComponentGovernance }}
variables:
- AgentOsName: ${{ parameters.agentOs }}
- ASPNETCORE_TEST_LOG_MAXPATH: "200" # Keep test log file name length low enough for artifact zipping
- BuildScriptArgs: ${{ parameters.buildArgs }}
- _BuildConfig: ${{ parameters.configuration }}
- BuildConfiguration: ${{ parameters.configuration }}
- BuildDirectory: ${{ parameters.buildDirectory }}
- DOTNET_CLI_HOME: $(System.DefaultWorkingDirectory)
- DOTNET_SKIP_FIRST_TIME_EXPERIENCE: true
- TeamName: AspNetCore
- ${{ if eq(parameters.agentOs, 'Linux') }}:
- LC_ALL: 'en_US.UTF-8'
- LANG: 'en_US.UTF-8'
- LANGUAGE: 'en_US.UTF-8'
- ${{ if ne(parameters.codeSign, true) }}:
- _SignType: ''
- ${{ else }}:
- ${{ if notin(variables['Build.Reason'], 'PullRequest') }}:
- _SignType: real
- ${{ if in(variables['Build.Reason'], 'PullRequest') }}:
- _SignType: test
- LC_ALL: 'en_US.UTF-8'
- LANG: 'en_US.UTF-8'
- LANGUAGE: 'en_US.UTF-8'
# Log environment variables in binary logs to ease debugging
- MSBUILDLOGALLENVIRONMENTVARIABLES: true
# Rely on task Arcade injects, not auto-injected build step.
- skipComponentGovernanceDetection: true
- ${{ each variable in parameters.variables }}:
# handle a variable list using "name" and "value" properties
# example:
# - name: [key]
# value: [value]
- ${{ if ne(variable.name, '') }}:
- name: ${{ variable.name }}
value: ${{ variable.value }}
# handle variable groups
- ${{ if ne(variable.group, '') }}:
- group: ${{ variable.group }}
# handle name/value pairs (converting them into variable list entries)
# example:
# - [name]: [value]
- ${{ if and(eq(variable.name, ''), eq(variable.group, '')) }}:
- ${{ each pair in variable }}:
- name: ${{ pair.key }}
value: ${{ pair.value }}
steps:
- ${{ if ne(parameters.agentOs, 'Windows') }}:
- script: df -h
displayName: Disk size
- ${{ if eq(parameters.agentOs, 'macOS') }}:
- script: sudo xcode-select -s /Applications/Xcode_14.2.0.app/Contents/Developer
displayName: Use XCode 14.2.0
- checkout: self
clean: true
- ${{ if and(eq(parameters.agentOs, 'Windows'), eq(parameters.isAzDOTestingJob, true)) }}:
- powershell: ./eng/scripts/InstallProcDump.ps1
displayName: Install ProcDump
- powershell: ./eng/scripts/StartDumpCollectionForHangingBuilds.ps1 $(ProcDumpPath)procdump.exe artifacts/dumps/ (Get-Date).AddMinutes(160) dotnet
displayName: Start background dump collection
- ${{ if eq(parameters.installNodeJs, 'true') }}:
- task: NodeTool@0
displayName: Install Node 20.x
inputs:
versionSpec: 20.x
- ${{ if and(eq(parameters.agentOs, 'Windows'), eq(parameters.isAzDOTestingJob, true)) }}:
- powershell: |
Write-Host "##vso[task.setvariable variable=SeleniumProcessTrackingFolder]$(Build.SourcesDirectory)\artifacts\tmp\selenium\"
./eng/scripts/InstallGoogleChrome.ps1
displayName: Install Chrome
- ${{ if eq(parameters.agentOs, 'Windows') }}:
- powershell: Write-Host "##vso[task.prependpath]$(DOTNET_CLI_HOME)\.dotnet\tools"
displayName: Add dotnet tools to path
- ${{ if ne(parameters.agentOs, 'Windows') }}:
- script: echo "##vso[task.prependpath]$(DOTNET_CLI_HOME)/.dotnet/tools"
displayName: Add dotnet tools to path
- ${{ parameters.beforeBuild }}
# - template: /eng/common/templates-official/steps/enable-internal-sources.yml@self
- template: /eng/common/templates-official/steps/enable-internal-runtimes.yml@self
# Populate dotnetbuilds-internal-container-read-token
- template: /eng/common/templates-official/steps/get-delegation-sas.yml
parameters:
federatedServiceConnection: 'dotnetbuilds-internal-read'
outputVariableName: 'dotnetbuilds-internal-container-read-token'
expiryInHours: 1
base64Encode: false
storageAccount: dotnetbuilds
container: internal
permissions: rl
# Add COMPlus_* environment variables to build steps.
- ${{ if ne(parameters.steps, '')}}:
- ${{ each step in parameters.steps }}:
# Include all properties e.g. `task: CmdLine@2` or `displayName: Build x64` _except_ a provided `env:`.
# Aim here is to avoid having two `env:` properties in the expanded YAML.
- ${{ each pair in step }}:
${{ if ne(pair.key, 'env') }}:
${{ pair.key }}: ${{ pair.value }}
env:
# Include the variables we always want.
COMPlus_DbgEnableMiniDump: 1
COMPlus_DbgMiniDumpName: "$(System.DefaultWorkingDirectory)/dotnet-%d.%t.core"
DotNetBuildsInternalReadSasToken: $(dotnetbuilds-internal-container-read-token)
# Expand provided `env:` properties, if any.
${{ if step.env }}:
${{ step.env }}
- ${{ if eq(parameters.steps, '')}}:
- ${{ if eq(parameters.agentOs, 'Windows') }}:
- script: $(BuildDirectory)\build.cmd -ci -prepareMachine -nativeToolsOnMachine -nobl -Configuration $(BuildConfiguration) $(BuildScriptArgs)
/p:DotNetSignType=$(_SignType)
displayName: Run build.cmd
env:
COMPlus_DbgEnableMiniDump: 1
COMPlus_DbgMiniDumpName: "$(System.DefaultWorkingDirectory)/dotnet-%d.%t.core"
DotNetBuildsInternalReadSasToken: $(dotnetbuilds-internal-container-read-token)
- ${{ if ne(parameters.agentOs, 'Windows') }}:
- script: $(BuildDirectory)/build.sh --ci --nobl --configuration $(BuildConfiguration) $(BuildScriptArgs)
displayName: Run build.sh
env:
COMPlus_DbgEnableMiniDump: 1
COMPlus_DbgMiniDumpName: "$(System.DefaultWorkingDirectory)/dotnet-%d.%t.core"
DotNetBuildsInternalReadSasToken: $(dotnetbuilds-internal-container-read-token)
- ${{ parameters.afterBuild }}
- ${{ if eq(parameters.agentOs, 'Linux') }}:
- script: df -h && du -h --threshold=50MB ..
displayName: Disk utilization
- ${{ if eq(parameters.agentOs, 'macOS') }}:
- script: df -h && du -h -d 3 ..
displayName: Disk utilization
- ${{ if and(eq(parameters.agentOs, 'Windows'), eq(parameters.isAzDOTestingJob, true)) }}:
- powershell: ./eng/scripts/FinishDumpCollectionForHangingBuilds.ps1 artifacts/dumps/
displayName: Finish background dump collection
continueOnError: true
condition: always()
- ${{ if eq(parameters.agentOs, 'Windows') }}:
- powershell: eng\scripts\KillProcesses.ps1
displayName: Kill processes
continueOnError: true
condition: always()
- ${{ if ne(parameters.agentOs, 'Windows') }}:
- script: eng/scripts/KillProcesses.sh
displayName: Kill processes
continueOnError: true
condition: always()
- ${{ each artifact in parameters.artifacts }}:
- task: 1ES.PublishPipelineArtifact@1
displayName: Upload artifacts from ${{ artifact.path }}
condition: and(or(succeeded(), eq('${{ artifact.publishOnError }}', 'true')), or(eq(variables['system.pullrequest.isfork'], false), eq('${{ artifact.includeForks }}', 'true')))
continueOnError: true
inputs:
# Assume runtime variable values are absolute paths already.
${{ if startsWith(artifact.path, '$(') }}:
path: ${{ artifact.path }}
${{ if not(startsWith(artifact.path, '$(')) }}:
path: $(Build.SourcesDirectory)/${{ artifact.path }}
${{ if eq(artifact.name, '') }}:
artifactName: artifacts-$(AgentOsName)-$(BuildConfiguration)
${{ if ne(artifact.name, '') }}:
artifactName: ${{ artifact.name }}
artifactType: Container
parallel: true
- ${{ if eq(parameters.agentOs, 'Windows') }}:
- powershell: $(Build.SourcesDirectory)/eng/scripts/UploadCores.ps1 -ProcDumpOutputPath artifacts/dumps/
condition: failed()
displayName: Upload cores
- ${{ if ne(parameters.agentOs, 'Windows') }}:
- script: $(Build.SourcesDirectory)/eng/scripts/upload-cores.sh
condition: failed()
displayName: Upload cores
- ${{ if and(eq(parameters.isAzDOTestingJob, true), ne(parameters.enablePublishTestResults, false)) }}:
- task: PublishTestResults@2
displayName: Publish js test results
condition: always()
inputs:
testResultsFormat: JUnit
testResultsFiles: '**/artifacts/log/**/*.junit.xml'
testRunTitle: $(AgentOsName)-$(BuildConfiguration)-js
mergeTestResults: true
buildConfiguration: $(BuildConfiguration)
buildPlatform: $(AgentOsName)