-
Notifications
You must be signed in to change notification settings - Fork 195
/
azure-pipelines-official.yml
427 lines (386 loc) · 16 KB
/
azure-pipelines-official.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
#
# See https://docs.microsoft.com/azure/devops/pipelines/yaml-schema for reference.
#
variables:
- template: /eng/common/templates-official/variables/pool-providers.yml@self
- name: Build.Repository.Clean
value: true
- name: _TeamName
value: AspNetCore
- name: DOTNET_SKIP_FIRST_TIME_EXPERIENCE
value: true
- name: LogLevel
value: 'All'
- name: RunIntegrationTests
value: false
- group: DotNet-DevDiv-Insertion-Workflow-Variables
- name: _DevDivDropAccessToken
value: $(dn-bot-devdiv-drop-rw-code-rw)
- group: DotNet-Roslyn-Insertion-Variables
- name: Razor.GitHubEmail
value: [email protected]
- name: Razor.GitHubToken
value: $(AccessToken-dotnet-build-bot-public-repo)
- name: Razor.GitHubUserName
value: dotnet-build-bot
- name: Insertion.CreateDraftPR
value: true
- name: Insertion.TitlePrefix
value: '[Auto Insertion]'
- name: Insertion.TitleSuffix
value: ''
- name: Codeql.Enabled
value: true
trigger:
batch: true
branches:
include:
- main
- main-vs-deps
- release/*
- internal/release/3.*
pr:
autoCancel: true
branches:
include:
- '*'
resources:
repositories:
- repository: 1ESPipelineTemplates
type: git
name: 1ESPipelineTemplates/1ESPipelineTemplates
ref: refs/tags/release
extends:
template: v1/1ES.Official.PipelineTemplate.yml@1ESPipelineTemplates
parameters:
featureFlags:
autoBaseline: true
sdl:
sourceAnalysisPool:
name: NetCore1ESPool-Svc-Internal
image: 1es-windows-2022
os: windows
policheck:
enabled: true
tsa:
enabled: true
configFile: '$(Build.SourcesDirectory)/eng/TSAConfig.gdntsa'
pool:
name: NetCore1ESPool-Svc-Internal
image: windows.vs2022preview.amd64
os: windows
customBuildTags:
- ES365AIMigrationTooling
stages:
- stage: build
displayName: Build
jobs:
- ${{ if and(notin(variables['Build.Reason'], 'PullRequest'), eq(variables['Build.SourceBranch'], 'refs/heads/main')) }}:
- template: /eng/common/templates-official/job/onelocbuild.yml@self
parameters:
LclSource: lclFilesfromPackage
LclPackageId: 'LCL-JUNO-PROD-RAZORTOOL'
MirrorRepo: razor
- template: /eng/common/templates-official/jobs/jobs.yml@self
parameters:
enablePublishBuildArtifacts: false
enablePublishTestResults: false
enablePublishUsingPipelines: false
enableSourcebuild: true
jobs:
# Code check
- ${{ if in(variables['Build.Reason'], 'PullRequest') }}:
- job: Code_check
displayName: Code check
pool:
name: $(DncEngInternalBuildPool)
demands: ImageOverride -equals windows.vs2022preview.amd64
steps:
- task: NuGetCommand@2
displayName: 'Clear NuGet caches'
condition: succeeded()
inputs:
command: custom
arguments: 'locals all -clear'
- task: NuGetAuthenticate@1
- powershell: ./restore.cmd -msbuildEngine dotnet -ci; ./eng/scripts/CodeCheck.ps1 -ci
displayName: Run eng/scripts/CodeCheck.ps1
# Windows based jobs. This needs to be separate from Unix based jobs because it generates
# TRX files. That can only be toggled at the top level template level, not at the individual
# job.
- template: /eng/common/templates-official/jobs/jobs.yml@self
parameters:
enablePublishBuildArtifacts: false
enablePublishTestResults: true
enableTelemetry: true
helixRepo: dotnet/razor
helixType: build.product/
# enableMicrobuild can't be read from a user-defined variable (Azure DevOps limitation)
${{ if notin(variables['Build.Reason'], 'PullRequest') }}:
enableMicrobuild: true
enablePublishBuildAssets: true
enablePublishUsingPipelines: true
jobs:
- job: Windows
timeoutInMinutes: 120
pool:
name: $(DncEngInternalBuildPool)
demands: ImageOverride -equals windows.vs2022preview.amd64
strategy:
matrix:
release:
_BuildConfig: Release
${{ if in(variables['Build.Reason'], 'PullRequest') }}:
_PublishArgs: ''
${{ if notin(variables['Build.Reason'], 'PullRequest') }}:
_PublishArgs: /p:DotNetPublishUsingPipelines=true
variables:
- _BuildArgs: ''
- XUNIT_LOGS: '$(Build.SourcesDirectory)\artifacts\log\$(_BuildConfig)'
- __VSNeverShowWhatsNew: 1
# Variables for internal Official builds
- ${{ if notin(variables['Build.Reason'], 'PullRequest') }}:
- _SignType: real
- _BuildArgs: /p:DotNetSignType=$(_SignType) /p:TeamName=$(_TeamName)
/p:OfficialBuildId=$(Build.BuildNumber)
/p:ManifestBuildBranch=$(Build.SourceBranchName)
/p:ManifestBuildNumber=$(Build.BuildNumber)
/p:VisualStudioDropName=Products/$(System.TeamProject)/$(Build.Repository.Name)/$(Build.SourceBranchName)/$(Build.BuildNumber)
/p:GenerateSbom=true
steps:
- task: NuGetCommand@2
displayName: 'Clear NuGet caches'
condition: succeeded()
inputs:
command: custom
arguments: 'locals all -clear'
- template: /eng/restore-internal-tools.yml
- powershell: ./eng/scripts/InstallProcDump.ps1
displayName: Install ProcDump
- powershell: ./eng/scripts/StartDumpCollectionForHangingBuilds.ps1
$(ProcDumpPath)procdump.exe artifacts/log/$(_BuildConfig)
(Get-Date).AddMinutes(60)
devenv, xunit.console, xunit.console.x86
displayName: Start background dump collection
- task: NuGetAuthenticate@1
# Don't create a binary log until we can customize the name
# https://github.com/dotnet/arcade/pull/12988
- script: eng\cibuild.cmd
-configuration $(_BuildConfig)
-msbuildEngine vs
-prepareMachine
-restore
-nobl
name: Restore
displayName: Restore
condition: succeeded()
- powershell: eng\SetupVSHive.ps1
displayName: Setup VS Hive
- script: eng\cibuild.cmd
-configuration $(_BuildConfig)
-msbuildEngine vs
-prepareMachine
-build
-pack
-publish
-sign
$(_BuildArgs)
$(_PublishArgs)
name: Build
displayName: Build and Deploy
condition: succeeded()
- script: eng\CIBuild.cmd
-configuration $(_BuildConfig)
-prepareMachine
-test
-nobl
name: Run_Unit_Tests
displayName: Run Unit Tests
condition: and(succeeded(), in(variables['Build.Reason'], 'PullRequest'))
- script: eng\CIBuild.cmd
-configuration $(_BuildConfig)
-prepareMachine
-integrationTest
name: Run_Integration_Tests
displayName: Run Integration Tests
condition: and(eq(variables['RunIntegrationTests'], true), succeeded(), in(variables['Build.Reason'], 'PullRequest'))
- powershell: ./eng/scripts/FinishDumpCollectionForHangingBuilds.ps1 artifacts/log/$(_BuildConfig)
displayName: Finish background dump collection
continueOnError: true
condition: always()
- task: 1ES.PublishPipelineArtifact@1
inputs:
targetPath: artifacts/log/$(_BuildConfig)
artifact: $(Agent.Os)_$(Agent.JobName) Attempt $(System.JobAttempt) Logs
displayName: Publish Build Artifacts
condition: always()
- task: 1ES.PublishPipelineArtifact@1
inputs:
targetPath: artifacts/TestResults/$(_BuildConfig)
artifact: $(Agent.Os)_$(Agent.JobName) Attempt $(System.JobAttempt) TestResults
displayName: Publish Test Artifacts
condition: in(variables['Build.Reason'], 'PullRequest')
# Publish an artifact that the RoslynInsertionTool is able to find by its name.
- task: 1ES.PublishPipelineArtifact@1
inputs:
targetPath: artifacts\VSSetup\$(_BuildConfig)
artifact: VSSetup
displayName: Publish VSSetup
condition: and(succeeded(), eq(variables['system.pullrequest.isfork'], false), eq(variables['_BuildConfig'], 'Release'))
- task: 1ES.PublishPipelineArtifact@1
inputs:
targetPath: artifacts\packages\$(_BuildConfig)
artifact: Packages_$(Agent.Os)_$(_BuildConfig)
displayName: Publish package artifacts
condition: and(succeeded(), eq(variables['system.pullrequest.isfork'], false), eq(variables['_BuildConfig'], 'Release'))
- powershell: Write-Host "##vso[task.setvariable variable=VisualStudio.DropName]Products/$(System.TeamProject)/$(Build.Repository.Name)/$(Build.SourceBranchName)/$(Build.BuildNumber)"
displayName: Setting VisualStudio.DropName variable
# Publishes setup VSIXes to a drop.
# Note: The insertion tool looks for the display name of this task in the logs.
- task: 1ES.MicroBuildVstsDrop@1
displayName: Upload VSTS Drop
inputs:
dropName: $(VisualStudio.DropName)
dropFolder: 'artifacts\VSSetup\$(_BuildConfig)\Insertion'
accessToken: $(_DevDivDropAccessToken)
dropRetentionDays: 90
continueOnError: true
condition: and(succeeded(), eq(variables['system.pullrequest.isfork'], false), eq(variables['_BuildConfig'], 'Release'))
# Unix jobs done as a group since they share the same test results format.
- template: /eng/common/templates-official/jobs/jobs.yml@self
parameters:
enablePublishBuildArtifacts: false
enablePublishTestResults: true
enableTelemetry: true
testResultsFormat: xunit
helixRepo: dotnet/razor
helixType: build.product/
jobs:
- job: macOS
pool:
name: Azure Pipelines
image: macOS-14
os: macOS
strategy:
matrix:
release:
_BuildConfig: Release
variables:
- _BuildArgs: ''
# Variables for internal Official builds
- ${{ if notin(variables['Build.Reason'], 'PullRequest') }}:
- _BuildArgs: /p:DotNetPublishUsingPipelines=true
/p:OfficialBuildId=$(Build.BuildNumber)
steps:
- task: Bash@3
displayName: Setup Private Feeds Credentials
inputs:
filePath: $(Build.SourcesDirectory)/eng/common/SetupNugetSources.sh
arguments: $(Build.SourcesDirectory)/NuGet.config $Token
env:
Token: $(dn-bot-dnceng-artifact-feeds-rw)
- task: NuGetAuthenticate@1
- script: eng/cibuild.sh
--restore
--build
--pack
--publish
--configuration $(_BuildConfig)
--prepareMachine
--test
$(_BuildArgs)
name: Build
displayName: Restore, Build and Test
condition: succeeded()
- task: 1ES.PublishPipelineArtifact@1
inputs:
targetPath: artifacts/TestResults/$(_BuildConfig)
artifact: $(Agent.Os)_$(Agent.JobName) Attempt $(System.JobAttempt) TestResults
displayName: Publish Test Results
condition: always()
- job: Linux
pool:
name: $(DncEngInternalBuildPool)
demands: ImageOverride -equals 1es-ubuntu-2004
os: linux
strategy:
matrix:
release:
_BuildConfig: Release
variables:
- LC_ALL: 'en_US.UTF-8'
- LANG: 'en_US.UTF-8'
- LANGUAGE: 'en_US.UTF-8'
- _BuildArgs: ''
# Variables for internal Official builds
- ${{ if notin(variables['Build.Reason'], 'PullRequest') }}:
- _BuildArgs: /p:DotNetPublishUsingPipelines=true
/p:OfficialBuildId=$(Build.BuildNumber)
steps:
- task: NuGetAuthenticate@1
- script: eng/cibuild.sh
--restore
--build
--pack
--publish
--configuration $(_BuildConfig)
--prepareMachine
--test
$(_BuildArgs)
name: Build
displayName: Restore, Build and Test
condition: succeeded()
- task: 1ES.PublishPipelineArtifact@1
inputs:
targetPath: artifacts/TestResults/$(_BuildConfig)/
artifact: $(Agent.Os)_$(Agent.JobName) Attempt $(System.JobAttempt) TestResults
displayName: Publish Test Results
condition: always()
- ${{ if notin(variables['Build.Reason'], 'PullRequest') }}:
- template: /eng/common/templates-official/post-build/post-build.yml@self
parameters:
publishingInfraVersion: 3
enableSigningValidation: false
enableNugetValidation: false
SDLValidationParameters:
enable: true
params: >-
-SourceToolsList @("policheck","credscan")
-ArtifactToolsList @("binskim")
-BinskimAdditionalRunConfigParams @("IgnorePdbLoadError < True","Recurse < True")
-TsaInstanceURL $(_TsaInstanceURL)
-TsaProjectName $(_TsaProjectName)
-TsaNotificationEmail $(_TsaNotificationEmail)
-TsaCodebaseAdmin $(_TsaCodebaseAdmin)
-TsaBugAreaPath $(_TsaBugAreaPath)
-TsaIterationPath $(_TsaIterationPath)
-TsaRepositoryName "Razor-Tooling"
-TsaCodebaseName "Razor-Tooling"
-TsaPublish $True
- stage: insert
dependsOn: publish_using_darc
displayName: Insert to VS
jobs:
- job: insert
displayName: Insert to VS
pool:
name: NetCore1ESPool-Svc-Internal
demands: ImageOverride -equals windows.vs2022.amd64
steps:
- download: current
artifact: VSSetup
- powershell: |
$branchName = "$(Build.SourceBranch)".Substring("refs/heads/".Length)
Write-Host "##vso[task.setvariable variable=ComponentBranchName]$branchName"
displayName: Get Branch Name
- template: /eng/pipelines/insert.yml@self
parameters:
buildUserName: "[email protected]"
buildPassword: $(dn-bot-devdiv-build-e-code-full-release-e-packaging-r)
componentUserName: "[email protected]"
componentPassword: $(dn-bot-dnceng-build-e-code-full-release-e-packaging-r)
componentBuildProjectName: internal
sourceBranch: "$(ComponentBranchName)"
publishDataURI: "https://dev.azure.com/dnceng/internal/_apis/git/repositories/dotnet-razor/items?path=/eng/config/PublishData.json&api-version=6.0"
publishDataAccessToken: "$(System.AccessToken)"
dropPath: '$(Pipeline.Workspace)\VSSetup'