forked from dotnet/fsharp
-
Notifications
You must be signed in to change notification settings - Fork 0
/
azure-pipelines.yml
502 lines (484 loc) · 20.2 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
# CI and PR triggers
trigger:
branches:
include:
- main
- dev16.1
- feature/*
- release/*
paths:
include:
- '*'
exclude:
- .github/*
- docs/
- attributions.md
- CODE_OF_CONDUCT.md
- DEVGUIDE.md
- INTERNAL.md
- Language-Version-History.md
- License.txt
- README.md
- release-notes.md
- TESTGUIDE.md
pr:
branches:
include:
- main
- dev16.1
- feature/*
- release/*
paths:
include:
- '*'
exclude:
- .github/*
- docs/
- attributions.md
- CODE_OF_CONDUCT.md
- DEVGUIDE.md
- INTERNAL.md
- Language-Version-History.md
- License.txt
- README.md
- release-notes.md
- TESTGUIDE.md
variables:
- name: _TeamName
value: FSharp
- name: _BuildConfig
value: Release
- name: _PublishUsingPipelines
value: true
- name: _DotNetArtifactsCategory
value: .NETCore
- name: VisualStudioDropName
value: Products/$(System.TeamProject)/$(Build.Repository.Name)/$(Build.SourceBranchName)/$(Build.BuildNumber)
- ${{ if and(eq(variables['System.TeamProject'], 'public'), eq(variables['Build.Reason'], 'PullRequest')) }}:
- name: RunningAsPullRequest
value: true
# Variables defined in yml cannot be overridden at queue time; instead overridable variables must be defined in the web UI.
# Commenting out until something like this is supported: https://github.com/Microsoft/azure-pipelines-yaml/pull/129
#variables:
#- name: SkipTests
# defaultValue: false
stages:
- stage: build
displayName: Build
jobs:
#-------------------------------------------------------------------------------------------------------------------#
# Signed build #
#-------------------------------------------------------------------------------------------------------------------#
- ${{ if and(ne(variables['System.TeamProject'], 'public'), notin(variables['Build.Reason'], 'PullRequest')) }}:
- ${{ if eq(variables['Build.SourceBranch'], 'refs/heads/main') }}:
- template: /eng/common/templates/job/onelocbuild.yml
parameters:
MirrorRepo: fsharp
LclSource: lclFilesfromPackage
LclPackageId: 'LCL-JUNO-PROD-FSHARP'
- template: /eng/common/templates/jobs/jobs.yml
parameters:
enableMicrobuild: true
enablePublishBuildArtifacts: true
enablePublishTestResults: false
enablePublishBuildAssets: true
enablePublishUsingPipelines: $(_PublishUsingPipelines)
enableSourceBuild: true
enableTelemetry: true
helixRepo: dotnet/fsharp
jobs:
- job: Full_Signed
pool:
name: NetCore1ESPool-Svc-Internal
demands: ImageOverride -equals build.windows.10.amd64.vs2019
timeoutInMinutes: 300
variables:
- group: DotNet-Blob-Feed
- group: DotNet-Symbol-Server-Pats
- group: DotNet-DevDiv-Insertion-Workflow-Variables
- name: _SignType
value: Real
- name: _DotNetPublishToBlobFeed
value: true
steps:
- checkout: self
clean: true
- script: eng\CIBuild.cmd
-configuration $(_BuildConfig)
-prepareMachine
-testAll
-officialSkipTests $(SkipTests)
/p:SignType=$(_SignType)
/p:DotNetSignType=$(_SignType)
/p:MicroBuild_SigningEnabled=true
/p:OverridePackageSource=https://dotnetfeed.blob.core.windows.net/dotnet-core/index.json
/p:TeamName=$(_TeamName)
/p:DotNetPublishBlobFeedKey=$(dotnetfeed-storage-access-key-1)
/p:DotNetPublishBlobFeedUrl=https://dotnetfeed.blob.core.windows.net/dotnet-core/index.json
/p:DotNetPublishToBlobFeed=true
/p:DotNetPublishUsingPipelines=$(_PublishUsingPipelines)
/p:DotNetArtifactsCategory=$(_DotNetArtifactsCategory)
/p:DotNetSymbolServerTokenMsdl=$(microsoft-symbol-server-pat)
/p:DotNetSymbolServerTokenSymWeb=$(symweb-symbol-server-pat)
/p:OfficialBuildId=$(BUILD.BUILDNUMBER)
/p:PublishToSymbolServer=true
/p:VisualStudioDropName=$(VisualStudioDropName)
- script: .\tests\EndToEndBuildTests\EndToEndBuildTests.cmd -c $(_BuildConfig)
displayName: End to end build tests
- task: PublishTestResults@2
displayName: Publish Test Results
inputs:
testResultsFormat: 'NUnit'
testResultsFiles: '*.xml'
searchFolder: '$(Build.SourcesDirectory)/artifacts/TestResults/$(_BuildConfig)'
continueOnError: true
condition: ne(variables['SkipTests'], 'true')
- task: PublishBuildArtifacts@1
displayName: Publish Test Logs
inputs:
PathtoPublish: '$(Build.SourcesDirectory)\artifacts\TestResults\$(_BuildConfig)'
ArtifactName: 'Test Logs'
publishLocation: Container
continueOnError: true
condition: ne(variables['SkipTests'], 'true')
- task: PublishBuildArtifacts@1
displayName: Publish Artifact Packages
inputs:
PathtoPublish: '$(Build.SourcesDirectory)\artifacts\packages\$(_BuildConfig)'
ArtifactName: 'Packages'
condition: succeeded()
- task: PublishBuildArtifacts@1
displayName: Publish Artifact VSSetup
inputs:
PathtoPublish: '$(Build.SourcesDirectory)\artifacts\VSSetup\$(_BuildConfig)\Insertion'
ArtifactName: 'VSSetup'
condition: succeeded()
- task: PublishBuildArtifacts@1
displayName: Publish Artifact Nightly
inputs:
PathtoPublish: '$(Build.SourcesDirectory)\artifacts\VSSetup\$(_BuildConfig)\VisualFSharpDebug.vsix'
ArtifactName: 'Nightly'
condition: succeeded()
- task: PublishBuildArtifacts@1
displayName: Publish Artifact Symbols
inputs:
PathtoPublish: '$(Build.SourcesDirectory)\artifacts\SymStore\$(_BuildConfig)'
ArtifactName: 'NativeSymbols'
condition: succeeded()
- task: ms-vseng.MicroBuildTasks.4305a8de-ba66-4d8b-b2d1-0dc4ecbbf5e8.MicroBuildUploadVstsDropFolder@1
displayName: Upload VSTS Drop
inputs:
DropName: $(VisualStudioDropName)
DropFolder: '$(Build.SourcesDirectory)\artifacts\VSSetup\$(_BuildConfig)\Insertion'
AccessToken: $(dn-bot-devdiv-drop-rw-code-rw)
condition: succeeded()
#-------------------------------------------------------------------------------------------------------------------#
# PR builds #
#-------------------------------------------------------------------------------------------------------------------#
- ${{ if eq(variables['System.TeamProject'], 'public') }}:
- template: /eng/common/templates/jobs/jobs.yml
parameters:
enableMicrobuild: true
enablePublishBuildArtifacts: true
enablePublishTestResults: false
enablePublishBuildAssets: true
enablePublishUsingPipelines: $(_PublishUsingPipelines)
enableSourceBuild: true
enableTelemetry: true
helixRepo: dotnet/fsharp
jobs:
# Windows
- job: Windows
pool:
# The PR build definition sets this variable:
# WindowsMachineQueueName=Build.Windows.10.Amd64.VS2019.Open
# and there is an alternate build definition that sets this to a queue that is always scouting the
# next preview of Visual Studio.
name: NetCore1ESPool-Svc-Public
demands: ImageOverride -equals $(WindowsMachineQueueName)
timeoutInMinutes: 120
strategy:
maxParallel: 4
matrix:
desktop_release:
_configuration: Release
_testKind: testDesktop
coreclr_release:
_configuration: Release
_testKind: testCoreclr
fsharpqa_release:
_configuration: Release
_testKind: testFSharpQA
vs_release:
_configuration: Release
_testKind: testVs
steps:
- checkout: self
clean: true
- script: eng\CIBuild.cmd -configuration $(_configuration) -$(_testKind)
displayName: Build / Test
- task: PublishTestResults@2
displayName: Publish Test Results
inputs:
testResultsFormat: 'NUnit'
testResultsFiles: '*.xml'
searchFolder: '$(Build.SourcesDirectory)/artifacts/TestResults/$(_configuration)'
continueOnError: true
condition: ne(variables['_testKind'], 'testFSharpQA')
- task: PublishBuildArtifacts@1
displayName: Publish Test Logs
inputs:
PathtoPublish: '$(Build.SourcesDirectory)\artifacts\TestResults\$(_configuration)'
ArtifactName: 'Windows $(_configuration) $(_testKind) test logs'
publishLocation: Container
continueOnError: true
condition: failed()
- script: dotnet build $(Build.SourcesDirectory)/eng/DumpPackageRoot/DumpPackageRoot.csproj
displayName: Dump NuGet cache contents
condition: failed()
- task: PublishBuildArtifacts@1
displayName: Publish NuGet cache contents
inputs:
PathtoPublish: '$(Build.SourcesDirectory)\artifacts\NugetPackageRootContents'
ArtifactName: 'NuGetPackageContents Windows $(_testKind)'
publishLocation: Container
continueOnError: true
condition: failed()
# Mock official build
- job: MockOfficial
pool:
vmImage: windows-latest
steps:
- checkout: self
clean: true
- pwsh: .\eng\MockBuild.ps1
displayName: Build with OfficialBuildId
# Linux
- job: Linux
pool:
vmImage: ubuntu-latest
variables:
- name: _SignType
value: Test
steps:
- checkout: self
clean: true
- script: ./eng/cibuild.sh --configuration $(_BuildConfig) --testcoreclr
displayName: Build / Test
- task: PublishTestResults@2
displayName: Publish Test Results
inputs:
testResultsFormat: 'NUnit'
testResultsFiles: '*.xml'
searchFolder: '$(Build.SourcesDirectory)/artifacts/TestResults/$(_BuildConfig)'
continueOnError: true
condition: always()
- task: PublishBuildArtifacts@1
displayName: Publish Test Logs
inputs:
PathtoPublish: '$(Build.SourcesDirectory)/artifacts/TestResults/$(_BuildConfig)'
ArtifactName: 'Linux $(_BuildConfig) test logs'
publishLocation: Container
continueOnError: true
condition: failed()
- script: dotnet build $(Build.SourcesDirectory)/eng/DumpPackageRoot/DumpPackageRoot.csproj
displayName: Dump NuGet cache contents
condition: failed()
- task: PublishBuildArtifacts@1
displayName: Publish NuGet cache contents
inputs:
PathtoPublish: '$(Build.SourcesDirectory)/artifacts/NugetPackageRootContents'
ArtifactName: 'NuGetPackageContents Linux'
publishLocation: Container
continueOnError: true
condition: failed()
# MacOS
- job: MacOS
pool:
vmImage: macOS-latest
variables:
- name: _SignType
value: Test
steps:
- checkout: self
clean: true
- script: ./eng/cibuild.sh --configuration $(_BuildConfig) --testcoreclr
displayName: Build / Test
- task: PublishTestResults@2
displayName: Publish Test Results
inputs:
testResultsFormat: 'NUnit'
testResultsFiles: '*.xml'
searchFolder: '$(Build.SourcesDirectory)/artifacts/TestResults/$(_BuildConfig)'
continueOnError: true
condition: always()
- task: PublishBuildArtifacts@1
displayName: Publish Test Logs
inputs:
PathtoPublish: '$(Build.SourcesDirectory)/artifacts/TestResults/$(_BuildConfig)'
ArtifactName: 'MacOS $(_BuildConfig) test logs'
publishLocation: Container
continueOnError: true
condition: failed()
- script: dotnet build $(Build.SourcesDirectory)/eng/DumpPackageRoot/DumpPackageRoot.csproj
displayName: Dump NuGet cache contents
condition: failed()
- task: PublishBuildArtifacts@1
displayName: Publish NuGet cache contents
inputs:
PathtoPublish: '$(Build.SourcesDirectory)/artifacts/NugetPackageRootContents'
ArtifactName: 'NuGetPackageContents Mac'
publishLocation: Container
continueOnError: true
condition: failed()
# End to end build
- job: EndToEndBuildTests
pool:
vmImage: windows-latest
steps:
- checkout: self
clean: true
- script: .\Build.cmd -c Release
- script: .\tests\EndToEndBuildTests\EndToEndBuildTests.cmd -c Release
displayName: End to end build tests
# Up-to-date - disabled due to it being flaky
#- job: UpToDate_Windows
# pool:
# vmImage: windows-latest
# steps:
# - checkout: self
# clean: true
# - task: PowerShell@2
# displayName: Run up-to-date build check
# inputs:
# filePath: eng\tests\UpToDate.ps1
# arguments: -configuration $(_BuildConfig) -ci -binaryLog
# Plain build Windows
- job: Plain_Build_Windows
pool:
vmImage: windows-latest
variables:
- name: _BuildConfig
value: Debug
steps:
- checkout: self
clean: true
- script: .\Build.cmd
displayName: Initial build
- script: dotnet --list-sdks
displayName: Report dotnet SDK versions
- task: UseDotNet@2
displayName: install SDK
inputs:
packageType: sdk
useGlobalJson: true
includePreviewVersions: true
workingDirectory: $(Build.SourcesDirectory)
installationPath: $(Agent.ToolsDirectory)/dotnet
- script: dotnet build .\FSharp.sln /bl:\"artifacts/log/$(_BuildConfig)/RegularBuild.binlog\"
env:
DOTNET_ROLL_FORWARD_TO_PRERELEASE: 1
displayName: Regular rebuild of FSharp.sln
- script: dotnet build .\FSharp.Compiler.Service.sln /bl:\"artifacts/log/$(_BuildConfig)/ServiceRegularBuild.binlog\"
workingDirectory: $(Build.SourcesDirectory)/service
env:
DOTNET_ROLL_FORWARD_TO_PRERELEASE: 1
displayName: Regular rebuild of FSharp.Compiler.Service.sln
# Plain build Linux
- job: Plain_Build_Linux
pool:
vmImage: ubuntu-latest
variables:
- name: _BuildConfig
value: Debug
steps:
- checkout: self
clean: true
- script: ./build.sh
displayName: Initial build
- script: dotnet --list-sdks
displayName: Report dotnet SDK versions
- task: UseDotNet@2
displayName: install SDK
inputs:
packageType: sdk
useGlobalJson: true
includePreviewVersions: true
workingDirectory: $(Build.SourcesDirectory)
installationPath: $(Agent.ToolsDirectory)/dotnet
- script: dotnet build ./FSharp.sln /bl:\"artifacts/log/$(_BuildConfig)/RegularBuild.binlog\"
env:
DOTNET_ROLL_FORWARD_TO_PRERELEASE: 1
displayName: Regular rebuild of FSharp.sln
- script: dotnet build ./FSharp.Compiler.Service.sln /bl:\"artifacts/log/$(_BuildConfig)/ServiceRegularBuild.binlog\"
workingDirectory: $(Build.SourcesDirectory)/service
env:
DOTNET_ROLL_FORWARD_TO_PRERELEASE: 1
displayName: Regular rebuild of FSharp.Compiler.Service.sln
# Plain build Mac
- job: Plain_Build_MacOS
pool:
vmImage: macos-latest
variables:
- name: _BuildConfig
value: Debug
steps:
- checkout: self
clean: true
- script: ./build.sh
displayName: Initial build
- script: dotnet --list-sdks
displayName: Report dotnet SDK versions
- task: UseDotNet@2
displayName: install SDK
inputs:
packageType: sdk
useGlobalJson: true
includePreviewVersions: true
workingDirectory: $(Build.SourcesDirectory)
installationPath: $(Agent.ToolsDirectory)/dotnet
- script: dotnet build ./FSharp.sln /bl:\"artifacts/log/$(_BuildConfig)/RegularBuild.binlog\"
env:
DOTNET_ROLL_FORWARD_TO_PRERELEASE: 1
displayName: Regular rebuild of FSharp.sln
- script: dotnet build ./FSharp.Compiler.Service.sln /bl:\"artifacts/log/$(_BuildConfig)/ServiceRegularBuild.binlog\"
workingDirectory: $(Build.SourcesDirectory)/service
env:
DOTNET_ROLL_FORWARD_TO_PRERELEASE: 1
displayName: Regular rebuild of FSharp.Compiler.Service.sln
# Arcade-powered source build
# turned off until https://github.com/dotnet/source-build/issues/1795 is fixed
# - template: /eng/common/templates/jobs/jobs.yml
# parameters:
# enablePublishUsingPipelines: true
# enablePublishBuildArtifacts: true
# enablePublishBuildAssets: true
# artifacts:
# publish:
# artifacts: true
# manifests: true
# runSourceBuild: true
# sourceBuildParameters:
# includeDefaultManagedPlatform: true
#---------------------------------------------------------------------------------------------------------------------#
# Post Build #
#---------------------------------------------------------------------------------------------------------------------#
- ${{ if and(ne(variables['System.TeamProject'], 'public'), notin(variables['Build.Reason'], 'PullRequest')) }}:
- template: eng/common/templates/post-build/post-build.yml
parameters:
publishingInfraVersion: 3
# Symbol validation is not entirely reliable as of yet, so should be turned off until https://github.com/dotnet/arcade/issues/2871 is resolved.
enableSymbolValidation: false
# SourceLink improperly looks for generated files. See https://github.com/dotnet/arcade/issues/3069
enableSourceLinkValidation: false
#---------------------------------------------------------------------------------------------------------------------#
# VS Insertion #
#---------------------------------------------------------------------------------------------------------------------#
- ${{ if and(ne(variables['System.TeamProject'], 'public'), notin(variables['Build.Reason'], 'PullRequest')) }}:
- template: eng/release/insert-into-vs.yml
parameters:
componentBranchName: refs/heads/release/dev17.0
insertTargetBranch: rel/d17.0
insertTeamEmail: fsharpteam@microsoft.com
insertTeamName: 'F#'
completeInsertion: 'auto'