/
handlers.yml
305 lines (287 loc) · 10.7 KB
/
handlers.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
trigger:
branches:
include:
- main
- release/*
- net7.0
- net8.0
- loc
tags:
include:
- '*'
paths:
include:
- '*'
exclude:
- .github/*
- docs/*
- CODE-OF-CONDUCT.md
- CONTRIBUTING.md
- LICENSE.TXT
- PATENTS.TXT
- README.md
- SECURITY.md
- THIRD-PARTY-NOTICES.TXT
pr:
branches:
include:
- main
- release/*
- net7.0
- net8.0
paths:
include:
- '*'
exclude:
- .github/*
- docs/*
- CODE-OF-CONDUCT.md
- CONTRIBUTING.md
- LICENSE.TXT
- PATENTS.TXT
- README.md
- SECURITY.md
- THIRD-PARTY-NOTICES.TXT
schedules:
- cron: "0 0 * * *"
displayName: Daily midnight build
branches:
include:
- main
variables:
- template: /eng/pipelines/common/variables.yml
- template: templates/common/vs-release-vars.yml@sdk-insertions
parameters:
- name: provisionatorChannel
displayName: 'Provisionator channel'
type: string
default: 'latest' # Support for launching a build against a Provisionator PR (e.g., pr/[github-account-name]/[pr-number]) as a means to test in-progress Provisionator changes
- name: BuildEverything
type: boolean
default: false
- name: RunCompliance
type: boolean
default: false
- name: BuildConfigurations
type: object
default:
- Debug
- Release
- name: BuildPlatforms
type: object
default:
- name: Windows
poolName: $(windowsNet6VmPool)
vmImage: $(windowsNet6VmImage)
bootsAndroid: $(Android.Msi)
artifact: build-windows
- name: macOS
poolName: $(macOSXNet6VmPool)
vmImage: $(macOSXNet6VmImage)
bootsAndroid: $(Android.Pkg)
bootsMacCatalyst: $(MacCatalyst.Pkg)
artifact: build-macos
- name: PackPlatforms
type: object
default:
- name: Windows
poolName: $(windowsNet6VmPool)
vmImage: $(windowsNet6VmImage)
bootsAndroid: $(Android.Msi)
artifact: nuget
- name: macOS
poolName: $(macOSXNet6VmPool)
vmImage: $(macOSXNet6VmImage)
bootsAndroid: $(Android.Pkg)
bootsMacCatalyst: $(MacCatalyst.Pkg)
artifact: nuget-macos
- name: RunTemplatePlatforms
type: object
default:
- name: $(androidTestsVmPool)
vmImage: $(androidTestsVmImage)
demands:
- macOS.Name -equals Ventura
- macOS.Architecture -equals x64
- Agent.OSVersion -equals 13.5
testName: RunOnAndroid
artifact: templates-run-android
- name: $(iosTestsVmPool)
vmImage: $(iosTestsVmImage)
demands:
- macOS.Name -equals Ventura
- macOS.Architecture -equals x64
- Agent.OSVersion -equals 13.5
testName: RunOniOS
artifact: templates-run-ios
- name: TestTargetFrameworks
type: object
default:
- name: default
tfm: default
- name: net8
tfm: net8.0
resources:
repositories:
- repository: yaml-templates
type: github
name: xamarin/yaml-templates
endpoint: xamarin
ref: refs/heads/main
- repository: sdk-insertions
type: github
name: xamarin/sdk-insertions
ref: refs/heads/main
endpoint: xamarin
stages:
- stage: build_net
displayName: Build .NET MAUI
dependsOn: []
jobs:
- ${{ each BuildPlatform in parameters.BuildPlatforms }}:
- ${{ each BuildConfiguration in parameters.BuildConfigurations }}:
- job: build_net_${{ BuildPlatform.name }}_${{ BuildConfiguration }}
workspace:
clean: all
displayName: ${{ BuildPlatform.name }} (${{ BuildConfiguration }})
timeoutInMinutes: 240
condition: or(
${{ parameters.BuildEverything }},
ne(variables['Build.Reason'], 'PullRequest'),
eq('${{ BuildConfiguration }}', 'Release'))
pool:
name: ${{ BuildPlatform.poolName }}
vmImage: ${{ BuildPlatform.vmImage }}
demands:
- macOS.Name -equals Ventura
- macOS.Architecture -equals x64
- Agent.OSVersion -equals 13.5
steps:
- template: common/provision.yml
parameters:
poolName: ${{ BuildPlatform.poolName }}
gitHubToken: $(github--pat--vs-mobiletools-engineering-service2)
- pwsh: ./build.ps1 --target=dotnet --configuration="${{ BuildConfiguration }}" --verbosity=diagnostic
displayName: 'Install .NET'
retryCountOnTaskFailure: 3
env:
DOTNET_TOKEN: $(dotnetbuilds-internal-container-read-token)
PRIVATE_BUILD: $(PrivateBuild)
- pwsh: ./build.ps1 --target=dotnet-build --configuration="${{ BuildConfiguration }}" --verbosity=diagnostic
displayName: 'Build .NET Maui'
- pwsh: ./build.ps1 --target=dotnet-test --configuration="${{ BuildConfiguration }}" --verbosity=diagnostic
displayName: 'Run Unit Tests'
- task: PublishTestResults@2
condition: always()
inputs:
testRunner: VSTest
testResultsFiles: '$(build.artifactstagingdirectory)/**/*.trx'
- task: PublishBuildArtifacts@1
condition: always()
displayName: Publish Artifacts (${{ BuildPlatform.artifact }})
inputs:
ArtifactName: ${{ BuildPlatform.artifact }}
- stage: pack_net
displayName: Pack .NET MAUI
dependsOn: []
jobs:
- ${{ each PackPlatform in parameters.PackPlatforms }}:
- job: pack_net_${{ PackPlatform.name }}
workspace:
clean: all
displayName: ${{ PackPlatform.name }}
timeoutInMinutes: 240
pool:
name: ${{ PackPlatform.poolName }}
vmImage: ${{ PackPlatform.vmImage }}
demands:
- macOS.Name -equals Ventura
- macOS.Architecture -equals x64
- Agent.OSVersion -equals 13.5
steps:
- template: common/pack.yml
parameters:
platform: ${{ PackPlatform.name }}
poolName: ${{ PackPlatform.poolName }}
provisionatorChannel: ${{ parameters.provisionatorChannel }}
artifact: ${{ PackPlatform.artifact }}
artifactBinaries: 'pack-binaries'
gitHubToken: $(github--pat--vs-mobiletools-engineering-service2)
- stage: samples_net
displayName: Test .NET MAUI Samples
dependsOn: pack_net
jobs:
- ${{ each BuildPlatform in parameters.BuildPlatforms }}:
- job: build_net_${{ BuildPlatform.name }}_samples
workspace:
clean: all
displayName: ${{ BuildPlatform.name }}
timeoutInMinutes: 120
pool:
name: ${{ BuildPlatform.poolName }}
vmImage: ${{ BuildPlatform.vmImage }}
demands:
- macOS.Name -equals Ventura
- macOS.Architecture -equals x64
- Agent.OSVersion -equals 13.5
steps:
- template: common/provision.yml
parameters:
poolName: ${{ BuildPlatform.poolName }}
- task: DownloadBuildArtifacts@0
displayName: 'Download Packages'
inputs:
artifactName: nuget
itemPattern: '**/*.nupkg'
downloadPath: $(System.DefaultWorkingDirectory)/artifacts
- pwsh: Move-Item -Path artifacts\nuget\*.nupkg -Destination artifacts -Force
displayName: Move the downloaded artifacts
- pwsh: ./build.ps1 --target=dotnet-local-workloads --verbosity=diagnostic
displayName: 'Install .NET (Local Workloads)'
retryCountOnTaskFailure: 3
env:
DOTNET_TOKEN: $(dotnetbuilds-internal-container-read-token)
PRIVATE_BUILD: $(PrivateBuild)
- pwsh: ./build.ps1 --target=dotnet-integration-build --verbosity=diagnostic
displayName: Build Microsoft.Maui.IntegrationTests
- pwsh: ./build.ps1 --target=dotnet-integration-test --filter="FullyQualifiedName=Microsoft.Maui.IntegrationTests.SampleTests" --resultsfilename="integration-samples" --verbosity=diagnostic
displayName: Run ${{ BuildPlatform.name }} sample build tests
- task: PublishTestResults@2
displayName: Publish the ${{ BuildPlatform.name }} sample build tests
condition: always()
inputs:
testRunner: VSTest
testResultsFiles: '$(build.artifactstagingdirectory)/**/*.trx'
testRunTitle: ${{ BuildPlatform.name }} sample build tests
- stage: templates_net
displayName: Test Templates
dependsOn: pack_net
jobs:
- template: common/maui-templates.yml
parameters:
RunPlatforms: ${{ parameters.RunTemplatePlatforms }}
BuildPlatforms: ${{ parameters.BuildPlatforms }}
- ${{ if eq(variables['System.TeamProject'], 'devdiv') }}:
- template: common/localization-handoff.yml # Process outgoing strings [Localization Handoff]
- template: common/localization-handback.yml # Process incoming translations and Create PR to main [Localization Handback]
- template: common/merge-translations-update.yml # Validating incoming translations strings and merge PR [Localization Handback]
- ${{ if or(eq(variables['Build.Reason'], 'Schedule'), parameters.RunCompliance) }}:
- template: security/full/v1.yml@yaml-templates
parameters:
stageDependsOn: 'pack_net'
complianceEnabled: true
complianceTimeoutInMinutes: 480
scanArtifacts: ['pack-binaries']
antiMalwareEnabled: true
binSkimEnabled: true
#binSkimTargetGlob: '$(Build.ArtifactStagingDirectory)\binaries-to-scan\pack-binaries\src\Controls\src\Nuget\bin\Release\net8.0\*.dll'
sourceGdnSuppressionFile: $(Build.SourcesDirectory)\eng\automation\guardian\source.gdnsuppress
tsaConfigFile: '$(Build.SourcesDirectory)\eng\automation\guardian\tsaoptions-v2.json'
policheckExclusionFile: '$(System.DefaultWorkingDirectory)\eng\automation\guardian\PoliCheck.Exclusions.xml'
policheckGdnSuppressionFilesFolder: '$(System.DefaultWorkingDirectory)\eng\automation\guardian'
credScanEnabled: true
credScanSuppressionFile: '$(System.DefaultWorkingDirectory)\eng\automation\guardian\CredScanSuppressions.json'
enableCodeInspector: true
apiScanEnabled: true
apiScanSoftwareName: 'MAUI'
apiScanSoftwareVersionNum: 8.0