forked from etas/vs-boost-unit-test-adapter
-
Notifications
You must be signed in to change notification settings - Fork 20
/
TestAdapterforBoost.TestDev17.yml
331 lines (330 loc) · 15.3 KB
/
TestAdapterforBoost.TestDev17.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
# This Yaml Document has been converted by ESAI Yaml Pipeline Conversion Tool.
# Please make sure to check all the converted content, it is your team's responsibility to make sure that the pipeline is still valid and functions as expected.
# The SBOM tasks have been removed because they are not required for the unofficial template.
# You can manually enable SBOM in the unofficial template if needed, othewise its automatically enabled when using official template. https://eng.ms/docs/cloud-ai-platform/devdiv/one-engineering-system-1es/1es-docs/1es-pipeline-templates/features/sbom
# This pipeline will be extended to the OneESPT template
# If you are not using the E+D shared hosted pool with windows-2022, replace the pool section with your hosted pool, os, and image name. If you are using a Linux image, you must specify an additional windows image for SDL: https://eng.ms/docs/cloud-ai-platform/devdiv/one-engineering-system-1es/1es-docs/1es-pipeline-templates/features/sdlanalysis/overview#how-to-specify-a-windows-pool-for-the-sdl-source-analysis-stage
# The Task 'PublishBuildArtifacts@1' has been converted to an output named 'Publish Artifact: drop' in the templateContext section.
trigger:
- refs/heads/dev17
- refs/heads/dev15
pr:
autoCancel: true
branches:
include:
- refs/heads/dev17
- refs/heads/dev15
- dev/*
schedules:
- cron: "0 7 1 * *"
displayName: Monthly Run
branches:
include:
- refs/heads/dev17
always: true
name: $(date:yyyyMMdd)$(rev:.r)
resources:
repositories:
- repository: MicroBuildTemplate
type: git
name: 1ESPipelineTemplates/MicroBuildTemplate
ref: refs/tags/release
- repository: VCLS-Extensions
type: git
name: VCLS-Extensions
ref: refs/heads/dev17
variables:
- name: ApiScanClientId
value: d318cba7-db4d-4fb3-99e1-01879cb74e91
- name: ArchiveSymbols
value: "$(TAfBTArchiveSymbols)"
- name: ArtifactServices.Symbol.AccountName
value: devdiv
- name: ArtifactServices.Symbol.PAT
value: "$(BoostTestSymbolsPat)"
- name: ArtifactServices.Symbol.UseAAD
value: false
- name: BuildConfiguration
value: "$(TAfBTBuildConfiguration)"
- name: BuildPlatform
value: Any CPU
- name: CodeQL.Enabled
value: True
- name: Codeql.Language
value: csharp,cpp
- name: CodeQL.TSAEnabled
value: True
- name: Codeql.TSAOptionsPath
value: $(Build.SourcesDirectory)\vs-boost-unit-test-adapter\TSAOptions.json
- name: DropRoot
value: '\\cpvsbuild\drops'
- name: Packaging.EnableSBOMSigning
value: "$(TAfBTEnableSBOMSigning)"
- name: ProductComponent
value: "$(TAfBTProductComponent)"
- name: Publish
value: "$(TAfBTPublish)"
# Quick build is used to skip some compliance tasks to quickly generate a .vsix for testing.
- name: RunAdditionalComplianceChecks
value: "$(TAfBTRunAdditionalComplianceChecks)"
- name: TAfBTRealSign
value: "$(RealSign)"
- name: RetainBuild
value: "$(TAfBTRetainBuild)"
- name: SignType
value: "$(TAfBTSignType)"
- name: TeamName
value: VCLS
- name: VersionNumber
value: "$(TAfBTVersionNumber)"
extends:
template: azure-pipelines/MicroBuild.1ES.Official.yml@MicroBuildTemplate
parameters:
pool:
name: VSEngSS-MicroBuild2022-1ES
sdl:
sourceAnalysisPool:
name: VSEngSS-MicroBuild2022-1ES
sourceRepositoriesToScan:
exclude:
# No need to scan this source as we only use this repo to copy the public signing key.
- repository: VCLS-Extensions
tsa:
enabled: true
configFile: '$(Build.SourcesDirectory)\TSAOptions.json'
binskim:
enabled: true
scanOutputDirectoryOnly: true
analyzeTargetGlob: '$(Build.ArtifactStagingDirectory)\drop\FilesToScanDrop\**\*.dll'
codeSignValidation:
additionalTargetsGlobPattern: -:f|$(Build.ArtifactStagingDirectory)\drop\out\**;-:f|$(Build.ArtifactStagingDirectory)\drop\_manifest\**;-:f|$(Build.ArtifactStagingDirectory)\drop\gdn-BoostUnitTestAdapter.vsix\**;-:f|$(Build.ArtifactStagingDirectory)\drop\*.dll # Include only the files we own, build, and ship (located in /FilesToScanDrop). All other dependency binaries shipped in the .vsix are already signed by Microsoft directly.
codeql:
compiled:
enabled: false
justificationForDisabling: 'There is a bug in the 1ES template that auto injects multiple CodeQL Initialize tasks when checking out multiple repos. This causes an endless CodeQL hang during pipeline builds.'
customBuildTags:
- ES365AIMigrationTooling
stages:
- stage: stage
jobs:
- job: Phase_1
displayName: Phase 1
timeoutInMinutes: 0
cancelTimeoutInMinutes: 1
templateContext:
outputs:
- output: pipelineArtifact
displayName: 'Publish Artifact: drop'
targetPath: $(Build.ArtifactStagingDirectory)\drop
artifactName: drop
mb:
signing:
enabled: true
signType: $(SignType)
localization:
enabled: true
steps:
- checkout: self
displayName: 'Checkout vs-boost-unit-test-adapter Git Repo'
clean: true
fetchDepth: 1
persistCredentials: true
- checkout: VCLS-Extensions
displayName: 'Checkout VCLS-Extensions ADO Repo to copy public key'
clean: true
fetchDepth: 1
persistCredentials: true
# After checking out the vs-boost-unit-test-adapter repo copy all files up one directory to avoid having to change all paths in scripts.
- task: CopyFiles@2
displayName: 'Copy vs-boost-unit-test-adapter Files to: $(Build.SourcesDirectory)'
inputs:
SourceFolder: '$(Build.SourcesDirectory)\vs-boost-unit-test-adapter'
TargetFolder: '$(Build.SourcesDirectory)'
- task: NuGetToolInstaller@1
displayName: Install NuGet
inputs:
versionSpec: 5.9.1
- task: ms-vseng.MicroBuildTasks.32f78468-e895-4f47-962c-58a699361df8.MicroBuildSwixPlugin@4
displayName: Install Swix Plugin
# Have to use manual CodeQL Init task for now because the 1ES template auto injected CodeQL contains bug that hangs during pipeline builds.
- task: MS-CST-E.codeql-3000-release.init-task.CodeQL3000Init@0
displayName: CodeQL 3000 Init
- task: PowerShell@2
displayName: Set Version
inputs:
targetType: filePath
filePath: './SetVersion.ps1'
arguments: '-version $(VersionNumber)'
- task: CopyFiles@2
displayName: 'Copy FinalPublicKey.snk to vs-boost-unit-test-adapter'
inputs:
SourceFolder: '$(Build.SourcesDirectory)/VCLS-Extensions/InternalAPIs/DevDiv'
Contents: 'FinalPublicKey.snk'
TargetFolder: '$(Build.SourcesDirectory)'
- task: PowerShell@1
displayName: Add Keys for RealSign to TAfBT
inputs:
scriptType: inlineScript
inlineScript: |-
$projects_to_sign = @(
"Antlr.DOT\Antlr.DOT.csproj",
"BoostTestAdapter\BoostTestAdapter.csproj",
"BoostTestPackage\BoostTestPackage.csproj",
"BoostTestPlugin\BoostTestPlugin.csproj",
"BoostTestShared\BoostTestShared.csproj",
"ThirdPartySigning\ThirdPartySigning.csproj",
"VisualStudioAdapter\VisualStudioAdapter.csproj"
)
$projects_to_sign | ForEach-Object {
$xml = [xml](Get-Content $_)
$KeyFile = $xml.CreateElement("AssemblyOriginatorKeyFile", "http://schemas.microsoft.com/developer/msbuild/2003")
$KeyFile.set_InnerXML("`$(EnlistmentRoot)FinalPublicKey.snk")
$xml | ForEach-Object { $_.Project.PropertyGroup | ForEach-Object { if ($_.Condition -like '*(RealSign)'' == ''True''') { $_.AppendChild($KeyFile) } } }
$xml.Save("$pwd\$_")
}
- task: NuGetCommand@2
displayName: NuGet restore for ThirdPartySigning and MicroBuild.Core
inputs:
solution: swix/packages.config
selectOrConfig: config
nugetConfigPath: NuGet.config
noCache: true
packagesDirectory: NuGetPackages
- task: NuGetCommand@2
displayName: NuGet restore
inputs:
solution: BoostTestAdapter.sln
selectOrConfig: config
nugetConfigPath: NuGet.config
noCache: true
- task: VSBuild@1
displayName: Build solution BoostTestAdapter.sln
inputs:
solution: BoostTestAdapter.sln
platform: $(BuildPlatform)
configuration: $(BuildConfiguration)
maximumCpuCount: true
createLogFile: true
- task: CopyFiles@2
displayName: 'Copy Files to: $(Build.ArtifactStagingDirectory)\drop'
inputs:
Contents: '**\out\binaries\**'
TargetFolder: $(Build.ArtifactStagingDirectory)\drop
- task: AzureArtifacts.manifest-generator-task.manifest-generator-task.ManifestGeneratorTask@0
displayName: 'Manifest Generator '
inputs:
BuildDropPath: '$(Build.ArtifactStagingDirectory)\drop'
PackageName: 'Test Adapter for Boost.Test'
PackageVersion: 1.1.0.4
- task: NuGetCommand@2
displayName: NuGet restore for vsmanproj
inputs:
solution: swix/packages.config
selectOrConfig: config
nugetConfigPath: NuGet.config
noCache: true
packagesDirectory: ..\NugetPackages
continueOnError: true
- task: VSBuild@1
displayName: Build vsmanproj
condition: and(succeeded(), eq(variables['ProductComponent'], true))
inputs:
solution: swix/Microsoft.VisualStudio.VC.Ide.TestAdapterForBoostTest.vsmanproj
msbuildArgs: /p:ArtifactsDir=$(Build.ArtifactStagingDirectory)
platform: $(BuildPlatform)
configuration: $(BuildConfiguration)
- task: CopyFiles@2
displayName: Copy setup files to drop root
inputs:
SourceFolder: out\binaries\$(BuildConfiguration)\Microsoft.VisualStudio.VC.Ide.TestAdapterForBoostTest
Contents: '*'
TargetFolder: $(Build.ArtifactStagingDirectory)\drop
continueOnError: true
- task: CopyFiles@2
displayName: Copy vsix to root
inputs:
SourceFolder: out\binaries\$(BuildConfiguration)\BoostTestPlugin
Contents: BoostUnitTestAdapter.vsix
TargetFolder: $(Build.ArtifactStagingDirectory)\drop
continueOnError: true
# Pull a list only of files we build and ship to be scanned in drop/FilesToScanDrop.
- task: PowerShell@2
displayName: 'Copy Scannable Files to: $(Build.ArtifactStagingDirectory)\drop\FilesToScanDrop'
inputs:
filePath: './FilesToScan.ps1'
arguments: '-buildArtifactStagingDirectory $(Build.ArtifactStagingDirectory)\drop -directoryToSearch $(Build.ArtifactStagingDirectory)\drop'
# This is a time-consuming compliance task, so if we want to run a quick build (off by default), then we skip this task.
- task: SDLNativeRules@3
displayName: 'Run the PREfast SDL Native Rules for MSBuild'
condition: eq (variables.RunAdditionalComplianceChecks, True)
env:
SYSTEM_ACCESSTOKEN: $(System.AccessToken)
inputs:
publishXML: true
userProvideBuildInfo: auto
rulesetName: Recommended
setupCommandlinePicker: 'vs2022'
# This is a time-consuming compliance task, so if we want to run a quick build (off by default), then we skip this task.
- task: PoliCheck@2
displayName: 'PoliCheck on vs-boost-unit-test-adapter repo'
condition: eq (variables.RunAdditionalComplianceChecks, True)
inputs:
targetType: 'F'
targetArgument: '$(Build.SourcesDirectory)/vs-boost-unit-test-adapter'
# This is a time-consuming compliance task, so if we want to run a quick build (off by default), then we skip this task.
- task: securedevelopmentteam.vss-secure-development-tools.build-task-apiscan.APIScan@2
displayName: 'Run APIScan'
condition: eq (variables.RunAdditionalComplianceChecks, True)
inputs:
softwareFolder: '$(Build.ArtifactStagingDirectory)\drop\FilesToScanDrop'
softwareName: BoostTest
softwareVersionNum: 1.0
isLargeApp: false
toolVersion: 'Latest'
verbosityLevel: silent
continueOnError: true
env:
AzureServicesAuthConnectionString: runAs=App;AppId=$(ApiScanClientId)
# Have to use manual CodeQL Init task for now because the 1ES template auto injected CodeQL contains bug that hangs during pipeline builds.
- task: MS-CST-E.codeql-3000-release.finalize-task.CodeQL3000Finalize@0
displayName: CodeQL 3000 Finalize
# This is a time-consuming compliance task, so if we want to run a quick build (off by default), then we skip this task.
- task: securedevelopmentteam.vss-secure-development-tools.build-task-publishsecurityanalysislogs.PublishSecurityAnalysisLogs@3
displayName: 'Publish Guardian Artifacts'
condition: eq (variables.RunAdditionalComplianceChecks, True)
inputs:
PublishProcessedResults: true
continueOnError: true
- task: 1ES.MicroBuildVstsDrop@1
displayName: Upload VSTS Drop
inputs:
dropFolder: $(Build.ArtifactStagingDirectory)\drop
dropName: Products/$(System.TeamProject)/$(Build.Repository.Name)/$(Build.SourceBranchName)/$(Build.BuildNumber)
accessToken: $(System.AccessToken)
dropServiceUri: https://devdiv.artifacts.visualstudio.com/DefaultCollection
vsDropServiceUri: "https://vsdrop.corp.microsoft.com/file/v1"
- task: ms-vseng.MicroBuildShipTasks.4a4e1dc3-01d0-484f-94ac-f918aaf7d509.MicroBuildRetainVstsDrops@1
displayName: Retain VSTS Drops
condition: and(succeeded(), eq(variables['RetainBuild'], true))
inputs:
DropNames: Products/$(System.TeamProject)/$(Build.Repository.Name)/$(Build.SourceBranchName)/$(Build.BuildNumber)
AccessToken: $(System.AccessToken)
DropServiceUri: https://devdiv.artifacts.visualstudio.com/DefaultCollection
- task: PublishSymbols@1
displayName: 'Publish Symbols Path'
inputs:
SearchPattern: out\binaries\**\*.pdb
continueOnError: true
- task: ms-vseng.MicroBuildShipTasks.0ffdda1d-8c7b-40da-b8b1-061660eaeea3.MicroBuildArchiveSymbols@5
displayName: 'Archive TestAdapterForBoostTest on Symweb'
condition: eq (variables.ArchiveSymbols, True)
inputs:
SymbolsFeatureName: TestAdapterForBoostTest
SymbolsProject: VS
SymbolsAgentPath: '$(Build.ArtifactStagingDirectory)\drop'
- task: ms-vseng.MicroBuildTasks.521a94ea-9e68-468a-8167-6dcf361ea776.MicroBuildCleanup@1
displayName: 'Send Telemetry'
condition: eq (variables.ArchiveSymbols, True)
- task: ms-vseng.MicroBuildTasks.521a94ea-9e68-468a-8167-6dcf361ea776.MicroBuildCleanup@1
displayName: Perform Cleanup Tasks
condition: always()