-
Notifications
You must be signed in to change notification settings - Fork 4.9k
/
Copy pathxplat-setup.yml
202 lines (175 loc) · 9.35 KB
/
xplat-setup.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
parameters:
jobTemplate: ''
hostedOs: ''
hostedArch: ''
osGroup: ''
osSubgroup: ''
archType: ''
container: ''
helixQueuesTemplate: ''
platform: ''
targetRid: ''
jobParameters: {}
shouldContinueOnError: false # set `shouldContinueOnError: forceFalse` to not use the defaults, and set specifically to `false`
variables: []
jobs:
- template: ${{ coalesce(parameters.helixQueuesTemplate, parameters.jobTemplate) }}
parameters:
shouldContinueOnError: ${{ or(eq(parameters.shouldContinueOnError, true), and(ne(parameters.shouldContinueOnError, 'forceFalse'), endsWith(variables['Build.DefinitionName'], 'staging'), eq(variables['Build.Reason'], 'PullRequest'))) }}
variables:
- template: /eng/common/${{ coalesce(parameters.jobParameters.templatePath, 'templates') }}/variables/pool-providers.yml
# Disable component governance in our CI builds. These builds are not shipping nor
# are they a service. Also the component governance jobs issue lots of inconsequential
# warnings and errors into our build timelines that make it hard to track down
# real errors in the build
- name: skipComponentGovernanceDetection
value: true
- name: runCodesignValidationInjection
value: false
- name: checkoutFetchDepth
value: 20
- name: buildConfigUpper
${{ if eq(parameters.jobParameters.buildConfig, 'debug') }}:
value: 'Debug'
${{ if eq(parameters.jobParameters.buildConfig, 'release') }}:
value: 'Release'
${{ if eq(parameters.jobParameters.buildConfig, 'checked') }}:
value: 'Checked'
- name: _BuildConfig
value: $(buildConfigUpper)
- name: archType
value: ${{ parameters.archType }}
- name: osGroup
value: ${{ parameters.osGroup }}
- name: osSubgroup
value: ${{ parameters.osSubgroup }}
- name: _runSmokeTestsOnlyArg
value: '/p:RunSmokeTestsOnly=$(isRunSmokeTestsOnly)'
- name: _overrideTestScriptWindowsCmdParameter
${{ if eq(parameters.jobParameters.runScriptWindowsCmd, true) }}:
value: '/p:RunScriptWindowsCmd=true'
${{ if ne(parameters.jobParameters.runScriptWindowsCmd, true) }}:
value: ''
- name: _hostedOs
value: ${{ parameters.jobParameters.hostedOs }}
- ${{ if or(eq(parameters.osGroup, 'windows'), eq(parameters.jobParameters.hostedOs, 'windows')) }}:
- name: archiveExtension
value: '.zip'
- name: archiveType
value: zip
- name: tarCompression
value: ''
- name: exeExt
value: '.exe'
- name: scriptExt
value: '.cmd'
- name: dir
value: '\'
- name: _msbuildCommand
value: powershell -ExecutionPolicy ByPass -NoProfile eng\common\msbuild.ps1 -ci
- name: _warnAsErrorParamHelixOverride
value: -warnaserror 0
- name: setScriptToEchoAndFailOnNonZero
value: ''
- name: logRootNameArg
value: 'log '
- ${{ if and(ne(parameters.osGroup, 'windows'), ne(parameters.jobParameters.hostedOs, 'windows')) }}:
- name: archiveExtension
value: '.tar.gz'
- name: archiveType
value: tar
- name: tarCompression
value: gz
- name: exeExt
value: ''
- name: scriptExt
value: '.sh'
- name: dir
value: '/'
- name: _msbuildCommand
value: ./eng/common/msbuild.sh --ci
- name: _warnAsErrorParamHelixOverride
value: --warnaserror false
# Set the bash script to display each command, and stop if any command exits nonzero.
- name: setScriptToEchoAndFailOnNonZero
value: 'set -xe'
- name: logRootNameArg
value: '-log:'
- name: runtimeFlavorName
${{ if eq(parameters.jobParameters.runtimeFlavor, 'mono') }}:
value: Mono
${{ if eq(parameters.jobParameters.runtimeFlavor, 'coreclr') }}:
value: CoreCLR
- ${{ if eq(parameters.archType, 'wasm') }}:
- name: wasmDarcDependenciesChanged
value: $[ or(
eq(stageDependencies.EvaluatePaths.evaluate_paths.outputs['DarcDependenciesChanged.Microsoft_NET_Workload_Emscripten_Current_Manifest-10_0_100_Transport'], true),
eq(stageDependencies.EvaluatePaths.evaluate_paths.outputs['DarcDependenciesChanged.Microsoft_DotNet_Build_Tasks_Workloads'], true),
eq(stageDependencies.EvaluatePaths.evaluate_paths.outputs['DarcDependenciesChanged.System_Runtime_TimeZoneData'], true),
eq(stageDependencies.EvaluatePaths.evaluate_paths.outputs['DarcDependenciesChanged.Microsoft_Net_Compilers_Toolset'], true),
eq(stageDependencies.EvaluatePaths.evaluate_paths.outputs['DarcDependenciesChanged.Microsoft_CodeAnalysis'], true),
eq(stageDependencies.EvaluatePaths.evaluate_paths.outputs['DarcDependenciesChanged.Microsoft_CodeAnalysis_CSharp'], true),
eq(stageDependencies.EvaluatePaths.evaluate_paths.outputs['DarcDependenciesChanged.Microsoft_CodeAnalysis_Analyzers'], true),
eq(stageDependencies.EvaluatePaths.evaluate_paths.outputs['DarcDependenciesChanged.Microsoft_CodeAnalysis_NetAnalyzers'], true),
eq(stageDependencies.EvaluatePaths.evaluate_paths.outputs['DarcDependenciesChanged.Microsoft_NET_ILLink_Tasks'], true)) ]
- name: shouldRunWasmBuildTestsOnDefaultPipeline
value: $[
or(
eq(variables['wasmDarcDependenciesChanged'], true),
eq(stageDependencies.EvaluatePaths.evaluate_paths.outputs['SetPathVars_tools_illink.containsChange'], true),
eq(stageDependencies.EvaluatePaths.evaluate_paths.outputs['SetPathVars_wasmbuildtests.containsChange'], true))
]
# needed for Wasm.Build.Tests
- name: wasmSingleThreadedBuildOnlyNeededOnDefaultPipeline
value: $[ variables['shouldRunWasmBuildTestsOnDefaultPipeline'] ]
- name: wasmMultiThreadedBuildOnlyNeededOnDefaultPipeline
value: $[ variables['shouldRunWasmBuildTestsOnDefaultPipeline'] ]
- ${{ each variable in parameters.variables }}:
- ${{ variable }}
osGroup: ${{ parameters.osGroup }}
osSubgroup: ${{ parameters.osSubgroup }}
archType: ${{ parameters.archType }}
targetRid: ${{ parameters.targetRid }}
platform: ${{ parameters.platform }}
${{ if ne(parameters.container, '') }}:
${{ if eq(parameters.container.registry, 'mcr') }}:
container: ${{ format('{0}:{1}', 'mcr.microsoft.com/dotnet-buildtools/prereqs', parameters.container.image) }}
${{ if and(ne(parameters.container.image, ''), ne(parameters.container.registry, 'mcr')) }}:
container: ${{ format('{0}:{1}', parameters.container.registry, parameters.container.image) }}
${{ if eq(parameters.container.image, '') }}:
container: ${{ parameters.container }}
${{ if eq(parameters.jobParameters.pool, '') }}:
pool:
# Public Linux Build Pool
${{ if and(or(in(parameters.osGroup, 'linux', 'freebsd', 'android', 'tizen'), eq(parameters.jobParameters.hostedOs, 'linux')), eq(variables['System.TeamProject'], 'public')) }}:
name: $(DncEngPublicBuildPool)
demands: ImageOverride -equals Build.Ubuntu.2204.Amd64.Open
# Official Build Linux Pool
${{ if and(or(in(parameters.osGroup, 'linux', 'freebsd', 'android', 'tizen'), eq(parameters.jobParameters.hostedOs, 'linux')), ne(variables['System.TeamProject'], 'public')) }}:
name: $(DncEngInternalBuildPool)
demands: ImageOverride -equals 1es-ubuntu-2204
os: linux
# OSX Public Build Pool (we don't have on-prem OSX BuildPool).
${{ if and(in(parameters.osGroup, 'osx', 'maccatalyst', 'ios', 'iossimulator', 'tvos', 'tvossimulator'), eq(variables['System.TeamProject'], 'public')) }}:
vmImage: 'macos-13'
# Official build OSX pool
${{ if and(in(parameters.osGroup, 'osx', 'maccatalyst', 'ios', 'iossimulator', 'tvos', 'tvossimulator'), ne(variables['System.TeamProject'], 'public')) }}:
name: "Azure Pipelines"
vmImage: 'macos-latest-internal'
os: macOS
# Official Build Windows Pool
${{ if and(or(eq(parameters.osGroup, 'windows'), eq(parameters.jobParameters.hostedOs, 'windows')), ne(variables['System.TeamProject'], 'public')) }}:
name: $(DncEngInternalBuildPool)
demands: ImageOverride -equals windows.vs2022.amd64
# Public Windows Build Pool
${{ if and(or(eq(parameters.osGroup, 'windows'), eq(parameters.jobParameters.hostedOs, 'windows')), eq(variables['System.TeamProject'], 'public')) }}:
name: $(DncEngPublicBuildPool)
demands: ImageOverride -equals windows.vs2022.amd64.open
${{ if eq(parameters.helixQueuesTemplate, '') }}:
# macOS hosted pool machines are slower so we need to give a greater timeout than the 60 mins default.
${{ if and(eq(parameters.jobParameters.timeoutInMinutes, ''), in(parameters.osGroup, 'osx', 'maccatalyst', 'ios', 'tvos')) }}:
timeoutInMinutes: 120
${{ insert }}: ${{ parameters.jobParameters }}
${{ if ne(parameters.helixQueuesTemplate, '') }}:
jobTemplate: ${{ parameters.jobTemplate }}
jobParameters: ${{ parameters.jobParameters }}