forked from dotnet/wcf
-
Notifications
You must be signed in to change notification settings - Fork 0
/
azure-pipelines-arcade-PR.yml
263 lines (247 loc) · 9.5 KB
/
azure-pipelines-arcade-PR.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
# trigger ci builds for merged PRs into listed branches
# Setting batch to true, triggers one build at a time.
# if there is a push while a build in progress, it will wait,
# until the running build finishes, and produce a build with all the changes
trigger:
batch: true
branches:
include:
- main
- release/3.*
- release/4.*
- release/6.*
# trigger ci builds for pull requests into listed branches
pr:
branches:
include:
- main
- release/3.*
- release/4.*
- release/6.*
variables:
- name: _TeamName
value: WcfCore
- name: _PublishUsingPipelines
value: true
- name: _DotNetArtifactsCategory
value: .NETCore
- name: _RunAsPublic
value: true
- name: _RunAsInternal
value: false
- name: _RunWithCoreWcfService
value: false
- ${{ if and(ne(variables['System.TeamProject'], 'public'), notin(variables['Build.Reason'], 'PullRequest')) }}:
- name: _RunAsPublic
value: false
- name: _RunAsInternal
value: true
- group: DotNet-Wcf-SDLValidation-Params
resources:
containers:
- container: ubuntu_2004_20211215
image: mcr.microsoft.com/dotnet-buildtools/prereqs:ubuntu-20.04-coredeps
stages:
- stage: Build
displayName: Build
jobs:
- ${{ if and(ne(variables['System.TeamProject'], 'public'), notin(variables['Build.Reason'], 'PullRequest'), eq(variables['Build.SourceBranch'], 'refs/heads/main')) }}:
- template: /eng/common/templates/job/onelocbuild.yml
parameters:
MirrorRepo: wcf
LclSource: lclFilesfromPackage
LclPackageId: 'LCL-JUNO-PROD-WCF'
- template: /eng/common/templates/jobs/jobs.yml
parameters:
enableMicrobuild: true
enablePublishBuildArtifacts: true
enablePublishBuildAssets: true
enablePublishUsingPipelines: $(_PublishUsingPipelines)
enableTelemetry: true
helixRepo: dotnet/wcf
jobs:
- job: Windows
timeoutInMinutes: 90
pool:
${{ if eq(variables._RunAsPublic, True) }}:
name: NetCore-Public
demands: ImageOverride -equals windows.vs2022.amd64.open
variables:
- _InternalBuildArgs: ''
- HelixApiAccessToken: ''
- _TestArgs: /p:ServiceUri=$(_serviceUri) /p:Root_Certificate_Installed=true /p:Client_Certificate_Installed=true /p:SSL_Available=true
# Public/PR & CI Build Variables
- ${{ if eq(variables._RunAsPublic, True) }}:
# For PR and CI test runs we use a different server machine that host multiple services to avoid concurrency issues.
- _serviceUri: wcfcoresrv23.westus3.cloudapp.azure.com/WcfService$(_WcfPRServiceId)
# For PR and CI test runs we need to update the Service being used by Scenario tests.
# Used in UpdatePRService.yml
# I think this can be removed based on the logic, setting it to true for now.
- _updateService: true
# Send to Helix variables
- _xUnitWorkItemTimeout: '00:10:00'
strategy:
matrix:
Release:
_BuildConfig: Release
# PRs or external builds are not signed.
${{ if eq(variables._RunAsPublic, True) }}:
_SignType: test
_DotNetPublishToBlobFeed : false
_WcfPRServiceId: 1
${{ if eq(variables._RunAsPublic, True) }}:
Debug:
_BuildConfig: Debug
_SignType: test
_DotNetPublishToBlobFeed : false
_WcfPRServiceId: 2
steps:
- checkout: self
clean: true
- ${{ if and(eq(variables._RunAsPublic, True), ne(variables._RunWithCoreWcfService, True)) }}:
- template: /eng/UpdatePRService.yml
parameters:
wcfPRServiceId: $(_WcfPRServiceId)
- script: eng\common\cibuild.cmd
-configuration $(_BuildConfig)
-preparemachine
$(_InternalBuildArgs)
$(_TestArgs)
/p:Test=false
displayName: Windows Build / Publish
- powershell: eng\common\build.ps1
-configuration $(_BuildConfig)
-preparemachine
-ci
-test
-integrationTest
-projects $(Build.SourcesDirectory)/eng/SendToHelix.proj
$(_TestArgs)
/p:TestJob=Windows
/p:RunWithCoreWcfService=$(_RunWithCoreWcfService)
/bl:$(Build.SourcesDirectory)/artifacts/log/$(_BuildConfig)/SendToHelix.binlog
displayName: Windows - Run Helix Tests
env:
SYSTEM_ACCESSTOKEN: $(System.AccessToken)
HelixAccessToken: $(HelixApiAccessToken)
XUnitWorkItemTimeout: $(_xUnitWorkItemTimeout)
RunAsPublic: $(_RunAsPublic)
RunAsInternal: $(_RunAsInternal)
IsWindowsBuild: true
# Only build and test Linux in PR and CI builds.
- ${{ if eq(variables._RunAsPublic, True) }}:
- job: Linux
timeoutInMinutes: 90
container: ubuntu_2004_20211215
pool:
name: NetCore-Public
demands: ImageOverride -equals build.Ubuntu.1804.Amd64.Open
variables:
- _TestArgs: /p:ServiceUri=$(_serviceUri) /p:Root_Certificate_Installed=true /p:Client_Certificate_Installed=true /p:SSL_Available=true
- _serviceUri: wcfcoresrv23.westus3.cloudapp.azure.com/WcfService$(_WcfPRServiceId)
- _updateService: true
# Send to Helix variables
- _xUnitWorkItemTimeout: '00:10:00'
strategy:
matrix:
Release:
_BuildConfig: Release
_SignType: none
_DotNetPublishToBlobFeed : false
_WcfPRServiceId: 3
_PublishType: none
Debug:
_BuildConfig: Debug
_SignType: none
_DotNetPublishToBlobFeed : false
_WcfPRServiceId: 4
_PublishType: none
steps:
- checkout: self
clean: true
- ${{ if and(eq(variables._RunAsPublic, True), ne(variables._RunWithCoreWcfService, True)) }}:
- template: /eng/UpdatePRService.yml
parameters:
wcfPRServiceId: $(_WcfPRServiceId)
- script: eng/common/cibuild.sh
-configuration $(_BuildConfig)
-preparemachine
$(_TestArgs)
/p:Test=false
displayName: Unix Build
- script: eng/common/build.sh
--configuration $(_BuildConfig)
--prepareMachine
--ci
--test
--integrationTest
--projects $(Build.SourcesDirectory)/eng/SendToHelix.proj
$(_TestArgs)
/p:TestJob=Linux
/p:RunWithCoreWcfService=$(_RunWithCoreWcfService)
/bl:$(Build.SourcesDirectory)/artifacts/log/$(_BuildConfig)/SendToHelix.binlog
displayName: Linux - Run Helix Tests
env:
SYSTEM_ACCESSTOKEN: $(System.AccessToken)
ServiceHost: $(_serviceUri)
RunAsPublic: $(_RunAsPublic)
RunAsInternal: $(_RunAsInternal)
IsWindowsBuild: false
# Only build and test MacOS in PR and CI builds.
- ${{ if eq(variables._RunAsPublic, True) }}:
- job: MacOS
timeoutInMinutes: 90
pool:
name: NetCore-Public
demands: ImageOverride -equals windows.vs2022.amd64.open
variables:
- _TestArgs: /p:ServiceUri=$(_serviceUri) /p:Root_Certificate_Installed=true /p:Client_Certificate_Installed=true /p:SSL_Available=true
- _serviceUri: wcfcoresrv23.westus3.cloudapp.azure.com/WcfService$(_WcfPRServiceId)
- _updateService: true
# Send to Helix variables
- _xUnitWorkItemTimeout: '00:10:00'
strategy:
matrix:
Release:
_BuildConfig: Release
_SignType: none
_DotNetPublishToBlobFeed : false
_WcfPRServiceId: 5
_PublishType: none
Debug:
_BuildConfig: Debug
_SignType: none
_DotNetPublishToBlobFeed : false
_WcfPRServiceId: 6
_PublishType: none
steps:
- checkout: self
clean: true
- ${{ if and(eq(variables._RunAsPublic, True), ne(variables._RunWithCoreWcfService, True)) }}:
- template: /eng/UpdatePRService.yml
parameters:
wcfPRServiceId: $(_WcfPRServiceId)
- script: eng\common\cibuild.cmd
-configuration $(_BuildConfig)
-preparemachine
$(_TestArgs)
/p:Test=false
displayName: MacOS Build
- powershell: eng\common\build.ps1
-configuration $(_BuildConfig)
-prepareMachine
-ci
-test
-integrationTest
-projects $(Build.SourcesDirectory)/eng/SendToHelix.proj
$(_TestArgs)
/p:TestJob=MacOS
/p:RunWithCoreWcfService=$(_RunWithCoreWcfService)
/bl:$(Build.SourcesDirectory)/artifacts/log/$(_BuildConfig)/SendToHelix.binlog
displayName: MacOS - Run Helix Tests
env:
SYSTEM_ACCESSTOKEN: $(System.AccessToken)
ServiceHost: $(_serviceUri)
RunAsPublic: $(_RunAsPublic)
RunAsInternal: $(_RunAsInternal)
IsWindowsBuild: false