Enable CoreFX test filtering for CoreCLR PRs (#24259)
[platform/upstream/coreclr.git] / azure-pipelines.yml
1
2 # Temporarily set a build number format that includes a large revision
3 # number that won't conflict with buildpipeline official builds.
4 name: $(Date:yyyyMMdd)$(Rev:.7r)
5
6 variables:
7   DOTNET_SKIP_FIRST_TIME_EXPERIENCE: true
8
9 resources:
10   containers:
11   - container: ubuntu_1404_arm_cross_build_image
12     image: mcr.microsoft.com/dotnet-buildtools/prereqs:ubuntu-14.04-cross-e435274-20180426002420
13
14   - container: ubuntu_1604_arm64_cross_build_image
15     image: mcr.microsoft.com/dotnet-buildtools/prereqs:ubuntu-16.04-cross-arm64-a3ae44b-20180315221921
16
17   - container: musl_x64_build_image
18     image: mcr.microsoft.com/dotnet-buildtools/prereqs:alpine-3.6-WithNode-f4d3fe3-20181220200247
19
20   - container: musl_arm64_build_image
21     image: mcr.microsoft.com/dotnet-buildtools/prereqs:ubuntu-16.04-cross-arm64-alpine-406629a-20190403203438
22
23   - container: centos7_x64_build_image
24     image: mcr.microsoft.com/dotnet-buildtools/prereqs:centos-7-d485f41-20173404063424
25
26   - container: centos6_x64_build_image
27     image: mcr.microsoft.com/dotnet-buildtools/prereqs:centos-6-376e1a3-20174311014331
28
29 trigger:
30 - master
31
32 pr:
33 - master
34
35 jobs:
36
37 ##   The following is the matrix of test runs that we have. This is
38 ##   duplicated for each os/arch combination in platform-matrix.yml.
39
40 ##
41 ##   Product build       Test build              Test run
42 ##   (Azure DevOps)      (Azure DevOps)          (helix)
43 ##
44 ##   ###########################################################################################
45 ##
46 ##   Debug
47 ##
48 ##   Checked ----------> Pri0 -----------------> plain runtests
49 ##           |
50 ##           \---------> Pri1 -----------------> plain runtests
51 ##           |                \----------------> jitstress
52 ##           |                \----------------> gcstress
53 ##           |                \----------------> maybe more (dynamically selected runtest modes)
54 ##           |
55 ##           \---------> Pri1 crossgen --------> plain runtests
56 ##                                     \-------> jitstress
57 ##                                     \-------> gcstress
58 ##                                     \-------> maybe more (dynamically selected runtest modes)
59 ##
60 ##   Release ----------> Pri1 -----------------> plain runtests
61 ##           |
62 ##           \---------> Pri1 crossgen --------> plain runtests
63 ##
64 ##
65
66 ## Each build or test job is defined in Azure DevOps, and will show
67 ## up in the UI in the order in which they are defined here. The
68 ## build and test build job matrix is defined statically, but
69 ## queue-time inputs can be used to control whether a job executes
70 ## (used to select which jobs run in ci vs for official builds), or
71 ## to select test modes. This should eventually be used to enable
72 ## requesting specific test runs from pull requests.
73
74
75 ##
76 ## Templates used to define jobs:
77 ## Please update this if the factoring changes.
78 ##
79 ## This file defines the set of jobs in a platform-agnostic manner,
80 ## using the platform-matrix.yml template. This will create one job
81 ## for each platform from the passed-in jobTemplate (either a build
82 ## job or a test job). The build-job.yml and test-job.yml templates
83 ## use xplat-job.yml to handle some of the common logic for
84 ## abstracting over platforms. Finally, xplat-job.yml uses the arcade
85 ## base.yml job template, which sets up telemetry and signing support.
86
87 ## azure-pipelines.yml -> platform-matrix.yml -------> build-job.yml -------> xplat-job.yml -> base.yml
88 ##                                            |  (passed-in jobTemplate)  |                    (arcade)
89 ##                                            \------> test-job.yml ------/
90
91 # TODO: simplify logic surrounding official build/ci. See
92 # https://github.com/Microsoft/azure-pipelines-yaml/pull/46 for more information
93
94 #
95 # Debug builds
96 #
97 - ${{ if and(eq(variables['System.TeamProject'], 'public'), eq(variables['Build.DefinitionName'], 'coreclr-ci')) }}:
98   - template: eng/platform-matrix.yml
99     parameters:
100       jobTemplate: build-job.yml
101       buildConfig: debug
102       ${{ if eq(variables['Build.Reason'], 'PullRequest') }}:
103         platforms:
104         - Windows_NT_x64
105         - Windows_NT_x86
106       ${{ if in(variables['Build.Reason'], 'IndividualCI', 'BatchedCI') }}:
107         platforms:
108         - Linux_arm
109         - Linux_arm64
110         - Linux_musl_arm64
111         - Linux_musl_x64
112         - Linux_rhel6_x64
113         - Linux_x64
114         - OSX_x64
115         - Windows_NT_arm
116         - Windows_NT_arm64
117
118 #
119 # Checked build
120 #
121 - ${{ if eq(variables['System.TeamProject'], 'public') }}:
122   - template: eng/platform-matrix.yml
123     parameters:
124       jobTemplate: build-job.yml
125       buildConfig: checked
126       ${{ if and(eq(variables['Build.Reason'], 'PullRequest'), eq(variables['Build.DefinitionName'], 'coreclr-ci')) }}:
127         platforms:
128         - Linux_arm
129         - Linux_arm64
130         - Linux_musl_x64
131         - Linux_x64
132         - OSX_x64
133         - Windows_NT_arm
134         - Windows_NT_arm64
135         - Windows_NT_x64
136         - Windows_NT_x86
137       ${{ if eq(variables['Build.DefinitionName'], 'coreclr-outerloop-gcstress0x3-gcstress0xc') }}:
138         platforms:
139         - Linux_arm
140         - Linux_arm64
141         - Linux_x64
142         - Windows_NT_x64
143         - Windows_NT_x86
144
145 #
146 # Release builds
147 #
148 - ${{ if and(eq(variables['System.TeamProject'], 'public'), eq(variables['Build.DefinitionName'], 'coreclr-ci')) }}:
149   - template: eng/platform-matrix.yml
150     parameters:
151       jobTemplate: build-job.yml
152       buildConfig: release
153       ${{ if eq(variables['Build.Reason'], 'PullRequest') }}:
154         platforms:
155         - Linux_arm64
156         - Linux_musl_x64
157         - Linux_rhel6_x64
158         - Windows_NT_arm
159         - Windows_NT_arm64
160         - Windows_NT_x64
161       ${{ if in(variables['Build.Reason'], 'IndividualCI', 'BatchedCI') }}:
162         platforms:
163         - Linux_arm
164         - Linux_musl_arm64
165         - Linux_x64
166         - OSX_x64
167         - Windows_NT_x86
168
169 #
170 # Release builds (Official build) - non-PullRequest
171 #
172 - ${{ if and(eq(variables['System.TeamProject'], 'internal'), ne(variables['Build.Reason'], 'PullRequest')) }}:
173   - template: eng/platform-matrix.yml
174     parameters:
175       jobTemplate: build-job.yml
176       buildConfig: release
177       jobParameters:
178         # Publishing packages to blob feeds sometimes takes a long time
179         # due to waiting for an exclusive lock on the feed.
180         # See https://github.com/dotnet/arcade/blob/master/Documentation/CorePackages/AsyncPublishing.md
181         timeoutInMinutes: 120
182
183 #
184 # Checked test builds
185 #
186 # The test jobs that can be triggered by a PR, manually from ADO and that are scheduled
187 - ${{ if and(eq(variables['System.TeamProject'], 'public'), in(variables['Build.Reason'], 'PullRequest', 'Manual', 'Schedule')) }}:
188   - template: eng/platform-matrix.yml
189     parameters:
190       jobTemplate: test-job.yml
191       buildConfig: checked
192       ${{ if and(eq(variables['Build.Reason'], 'PullRequest'), eq(variables['Build.DefinitionName'], 'coreclr-ci')) }}:
193         platforms:
194         - Linux_arm
195         - Linux_arm64
196         - Linux_musl_x64
197         - Linux_x64
198         - OSX_x64
199         - Windows_NT_arm
200         - Windows_NT_arm64
201         - Windows_NT_x64
202         - Windows_NT_x86
203       ${{ if eq(variables['Build.DefinitionName'], 'coreclr-outerloop-gcstress0x3-gcstress0xc') }}:
204         platforms:
205         - Linux_arm
206         - Linux_arm64
207         - Linux_x64
208         - Windows_NT_x64
209         - Windows_NT_x86
210       jobParameters:
211         ${{ if eq(variables['Build.DefinitionName'], 'coreclr-ci') }}:
212           testGroup: innerloop
213         ${{ if eq(variables['Build.DefinitionName'], 'coreclr-outerloop') }}:
214           testGroup: outerloop
215         ${{ if eq(variables['Build.DefinitionName'], 'coreclr-outerloop-jitminopts-jitstress1-jitstress2') }}:
216           testGroup: outerloop-jitminopts-jitstress1-jitstress2
217         ${{ if eq(variables['Build.DefinitionName'], 'coreclr-outerloop-jitstressregs') }}:
218           testGroup: outerloop-jitstressregs
219         ${{ if eq(variables['Build.DefinitionName'], 'coreclr-outerloop-jitstress2-jitstressregs') }}:
220           testGroup: outerloop-jitstress2-jitstressregs
221         ${{ if eq(variables['Build.DefinitionName'], 'coreclr-outerloop-gcstress0x3-gcstress0xc') }}:
222           testGroup: outerloop-gcstress0x3-gcstress0xc
223
224 # The ReadyToRun test jobs that are triggered by default from a PR.
225 - ${{ if and(eq(variables['System.TeamProject'], 'public'), eq(variables['Build.Reason'], 'PullRequest'), eq(variables['Build.DefinitionName'], 'coreclr-ci')) }}:
226   - template: eng/platform-matrix.yml
227     parameters:
228       jobTemplate: test-job.yml
229       buildConfig: checked
230       platforms:
231       - Linux_x64
232       - OSX_x64
233       - Windows_NT_x64
234       - Windows_NT_x86
235       jobParameters:
236         readyToRun: true
237         testGroup: innerloop
238         displayNameArgs: R2R
239   # The CoreFX runs against CoreCLR
240   - template: eng/platform-matrix.yml
241     parameters:
242       jobTemplate: test-job.yml
243       buildConfig: release
244       platforms:
245       - Windows_NT_x64
246       jobParameters:
247         corefxTests: true
248         testGroup: innerloop
249         displayNameArgs: CoreFX
250
251 # CI
252 - ${{ if and(eq(variables['System.TeamProject'], 'public'), in(variables['Build.Reason'], 'IndividualCI', 'BatchedCI')) }}:
253   - template: eng/platform-matrix.yml
254     parameters:
255       jobTemplate: test-job.yml
256       buildConfig: checked
257       jobParameters:
258         testGroup: outerloop
259
260   - template: eng/platform-matrix.yml
261     parameters:
262       jobTemplate: test-job.yml
263       buildConfig: checked
264       platforms:
265       - Linux_arm64
266       - Linux_musl_x64
267       - Linux_musl_arm64
268       - Linux_rhel6_x64
269       - Linux_x64
270       - OSX_x64
271       - Windows_NT_x64
272       - Windows_NT_x86
273       - Windows_NT_arm
274       - Windows_NT_arm64
275       jobParameters:
276         readyToRun: true
277         testGroup: outerloop
278         displayNameArgs: R2R
279
280 #
281 # Release test builds
282 #
283
284 # Pull-Request test
285 - ${{ if and(eq(variables['System.TeamProject'], 'public'), eq(variables['Build.Reason'], 'PullRequest'), eq(variables['Build.DefinitionName'], 'coreclr-ci')) }}:
286   - template: eng/platform-matrix.yml
287     parameters:
288       jobTemplate: test-job.yml
289       buildConfig: release
290       platforms:
291       - Linux_musl_x64
292       jobParameters:
293         testGroup: innerloop
294
295 # Official test
296 - ${{ if and(eq(variables['System.TeamProject'], 'internal'), ne(variables['Build.Reason'], 'PullRequest')) }}:
297   - template: eng/platform-matrix.yml
298     parameters:
299       jobTemplate: test-job.yml
300       buildConfig: release
301       jobParameters:
302         testGroup: outerloop
303
304   - template: eng/platform-matrix.yml
305     parameters:
306       jobTemplate: test-job.yml
307       buildConfig: release
308       jobParameters:
309         testGroup: outerloop
310         readyToRun: true
311         displayNameArgs: R2R
312
313
314 # Publish build information to Build Assets Registry
315
316 # This job gathers build assets from the pipeline (from each official
317 # product build job), and publishes them to the build assets
318 # registry. Its dependencies should be updated to include all of the
319 # official builds if we add more platform/arch combinations.
320
321 - ${{ if and(eq(variables['System.TeamProject'], 'internal'), ne(variables['Build.Reason'], 'PullRequest')) }}:
322   - template: /eng/finalize-publish.yml
323     parameters:
324       dependsOn:
325       - build_Linux_arm_release
326       - build_Linux_arm64_release
327       - build_Linux_musl_x64_release
328       - build_Linux_musl_arm64_release
329       - build_Linux_rhel6_x64_release
330       - build_Linux_x64_release
331       - build_OSX_x64_release
332       - build_Windows_NT_x64_release
333       - build_Windows_NT_x86_release
334       - build_Windows_NT_arm_release
335       - build_Windows_NT_arm64_release