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