forked from dotnet/test-templates
-
Notifications
You must be signed in to change notification settings - Fork 0
/
azure-pipelines-official.yml
136 lines (121 loc) · 4.65 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
# CI and PR triggers
trigger:
- main
- rel/*
pr:
- main
- rel/*
variables:
# Cannot use key:value syntax in root defined variables
- name: _TeamName
value: UnitTesting
- name: CodeQL.Enabled
value: false
- name: _RunAsInternal
value: True
- name: _RunAsPublic
value: False
# _SignType and _Sign are required for signing even if not used directly here
- name: _SignType
value: real
- name: _Sign
value: True
# Group gives access to $microsoft-symbol-server-pat and $symweb-symbol-server-pat
- group: DotNet-Symbol-Server-Pats
# Publish-Build-Assets provides: MaestroAccessToken, BotAccount-dotnet-maestro-bot-PAT
- group: Publish-Build-Assets
# Group gives access to $dn-bot-devdiv-drop-rw-code-rw and dn-bot-dnceng-build-rw-code-rw
- group: DotNet-VSTS-Infra-Access
- group: DotNet-DevDiv-Insertion-Workflow-Variables
- name: VisualStudioDropName
value: Products/$(System.TeamProject)/$(Build.Repository.Name)/$(Build.SourceBranchName)/$(Build.BuildNumber)
- name: _BuildConfig
value: Release
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
pool:
name: netcore1espool-internal
image: windows.vs2022preview.amd64
os: windows
customBuildTags:
- ES365AIMigrationTooling
stages:
- stage: build
displayName: Build
jobs:
- template: /eng/common/templates-official/jobs/jobs.yml@self
parameters:
enableMicrobuild: true
enablePublishBuildArtifacts: true
enablePublishBuildAssets: true
enablePublishUsingPipelines: true
enablePublishTestResults: true
enableTelemetry: true
enableSourceBuild: true
testResultsFormat: 'vstest'
helixRepo: dotnet/test-templates
jobs:
- job: Windows
pool:
name: netcore1espool-internal
image: windows.vs2022preview.amd64
os: windows
steps:
- checkout: self
clean: true
- task: NuGetAuthenticate@1
inputs:
nuGetServiceConnections: 'devdiv/dotnet-core-internal-tooling'
forceReinstallCredentialProvider: true
- script: eng\common\cibuild.cmd
-configuration $(_BuildConfig)
-prepareMachine
/p:TeamName=$(_TeamName)
/p:VisualStudioDropName=$(VisualStudioDropName)
/p:DotNetSymbolServerTokenMsdl=$(microsoft-symbol-server-pat)
/p:DotNetSymbolServerTokenSymWeb=$(symweb-symbol-server-pat)
/p:DotNetPublishUsingPipelines=true
/p:DotNetArtifactsCategory=.NETCore
/p:OfficialBuildId=$(BUILD.BUILDNUMBER)
/p:GenerateSbom=true
displayName: Build
- task: 1ES.PublishBuildArtifacts@1
displayName: 'Publish VSSetup'
inputs:
PathtoPublish: '$(Build.SourcesDirectory)/artifacts/VSSetup/$(_BuildConfig)'
ArtifactName: VSSetupArtifacts
- task: DotNetCoreCLI@2
displayName: 'Acceptance tests'
inputs:
command: test
projects: 'test\Microsoft.TestTemplates.Acceptance.Tests.sln'
publishTestResults: false
arguments: '--configuration $(_BuildConfig) --logger trx --results-directory $(Build.SourcesDirectory)/artifacts/TestResults/$(_BuildConfig)'
- task: 1ES.PublishBuildArtifacts@1
displayName: 'Publish acceptance tests logs'
inputs:
PathtoPublish: '$(Build.SourcesDirectory)/artifacts/bin/Microsoft.TestTemplates.Acceptance.Tests/Debug/net9.0/TestResults/Microsoft.TestTemplates.Acceptance.Tests_net9.0_x64.log'
ArtifactName: AcceptanceTestsLogs
condition: failed()
- script: dir /S artifacts\VSSetup\$(_BuildConfig)\Insertion
displayName: 'List Insertion files to upload'
- task: 1ES.MicroBuildVstsDrop@1
displayName: Upload Azure DevOps Drop
inputs:
dropName: $(VisualStudioDropName)
dropFolder: 'artifacts\VSSetup\$(_BuildConfig)\Insertion'
accessToken: $(dn-bot-devdiv-drop-rw-code-rw)
condition: succeeded()
- template: \eng\common\templates-official\post-build\post-build.yml@self
parameters:
enableSourceLinkValidation: false
publishingInfraVersion: 3