312d3f60ea9c792fa6f3a0940ee1731136896131
[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-alpine10fcdcf-20190208200917
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 - PullRequest & coreclr-ci / innerloop
96 #
97 - ${{ if and(eq(variables['System.TeamProject'], 'public'), eq(variables['Build.Reason'], 'PullRequest'), 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.DefinitionName'], 'coreclr-ci') }}:
103         platforms:
104         - Windows_NT_x64
105         - Windows_NT_x86
106
107 #
108 # Debug builds - PullRequest & coreclr-outerloop
109 #
110 - ${{ if and(eq(variables['System.TeamProject'], 'public'), eq(variables['Build.Reason'], 'PullRequest'), eq(variables['Build.DefinitionName'], 'coreclr-ci')) }}:
111   - template: eng/platform-matrix.yml
112     parameters:
113       jobTemplate: build-job.yml
114       buildConfig: debug
115       ${{ if eq(variables['Build.DefinitionName'], 'coreclr-outerloop') }}:
116         platforms:
117         - Linux_arm
118         - Linux_arm64
119         - Linux_musl_arm64
120         - Linux_musl_x64
121         - Linux_rhel6_x64
122         - Linux_x64
123         - OSX_x64
124         - Windows_NT_arm
125         - Windows_NT_arm64
126
127 #
128 # Checked builds - coreclr-ci / innerloop
129 #
130 - ${{ if eq(variables['System.TeamProject'], 'public') }}:
131   - template: eng/platform-matrix.yml
132     parameters:
133       jobTemplate: build-job.yml
134       buildConfig: checked
135       ${{ if eq(variables['Build.DefinitionName'], 'coreclr-ci') }}:
136         platforms:
137         - Linux_arm
138         - Linux_arm64
139         - Linux_musl_arm64
140         - Linux_musl_x64
141         - Linux_x64
142         - OSX_x64
143         - Windows_NT_arm
144         - Windows_NT_arm64
145         - Windows_NT_x64
146         - Windows_NT_x86
147
148 #
149 # Checked builds - coreclr-outerloop
150 #
151 - ${{ if eq(variables['System.TeamProject'], 'public') }}:
152   - template: eng/platform-matrix.yml
153     parameters:
154       jobTemplate: build-job.yml
155       buildConfig: checked
156       ${{ if eq(variables['Build.DefinitionName'], 'coreclr-outerloop') }}:
157         platforms:
158         - Linux_rhel6_x64
159
160 #
161 # Checked builds - gcstress
162 #
163 - ${{ if eq(variables['System.TeamProject'], 'public') }}:
164   - template: eng/platform-matrix.yml
165     parameters:
166       jobTemplate: build-job.yml
167       buildConfig: checked
168       ${{ if eq(variables['Build.DefinitionName'], 'coreclr-outerloop-gcstress0x3-gcstress0xc') }}:
169         platforms:
170         - Linux_arm
171         - Linux_arm64
172         - Linux_x64
173         - Windows_NT_x64
174         - Windows_NT_x86
175
176 #
177 # Release builds - PullRequest & coreclr-ci / innerloop
178 #
179 - ${{ if and(eq(variables['System.TeamProject'], 'public'), eq(variables['Build.Reason'], 'PullRequest'), eq(variables['Build.DefinitionName'], 'coreclr-ci')) }}:
180   - template: eng/platform-matrix.yml
181     parameters:
182       jobTemplate: build-job.yml
183       buildConfig: release
184       ${{ if eq(variables['Build.DefinitionName'], 'coreclr-ci') }}:
185         platforms:
186         - Linux_arm64
187         - Linux_musl_x64
188         - Linux_rhel6_x64
189         - Windows_NT_arm
190         - Windows_NT_arm64
191         - Windows_NT_x64
192
193 #
194 # Release builds - PullRequest & coreclr-outerloop
195 #
196 - ${{ if and(eq(variables['System.TeamProject'], 'public'), eq(variables['Build.Reason'], 'PullRequest'), eq(variables['Build.DefinitionName'], 'coreclr-ci')) }}:
197   - template: eng/platform-matrix.yml
198     parameters:
199       jobTemplate: build-job.yml
200       buildConfig: release
201       ${{ if eq(variables['Build.DefinitionName'], 'coreclr-outerloop') }}:
202         platforms:
203         - Linux_arm
204         - Linux_musl_arm64
205         - Linux_x64
206         - OSX_x64
207         - Windows_NT_x86
208
209 #
210 # Release builds (Official build) - non-PullRequest
211 #
212 - ${{ if and(eq(variables['System.TeamProject'], 'internal'), ne(variables['Build.Reason'], 'PullRequest')) }}:
213   - template: eng/platform-matrix.yml
214     parameters:
215       jobTemplate: build-job.yml
216       buildConfig: release
217       jobParameters:
218         # Publishing packages to blob feeds sometimes takes a long time
219         # due to waiting for an exclusive lock on the feed.
220         # See https://github.com/dotnet/arcade/blob/master/Documentation/CorePackages/AsyncPublishing.md
221         timeoutInMinutes: 120
222
223 #
224 # Checked test builds - PullRequest
225 # The test jobs that can be triggered by a PR, manually from ADO and that are scheduled
226 #
227 - ${{ if and(eq(variables['System.TeamProject'], 'public'), in(variables['Build.Reason'], 'PullRequest', 'Manual', 'Schedule')) }}:
228   - template: eng/platform-matrix.yml
229     parameters:
230       jobTemplate: test-job.yml
231       buildConfig: checked
232       ${{ if eq(variables['Build.DefinitionName'], 'coreclr-outerloop-gcstress0x3-gcstress0xc') }}:
233         platforms:
234         - Linux_arm
235         - Linux_arm64
236         - Linux_x64
237         - Windows_NT_x64
238         - Windows_NT_x86
239       jobParameters:
240         ${{ if eq(variables['Build.DefinitionName'], 'coreclr-ci') }}:
241           testGroup: innerloop
242         ${{ if eq(variables['Build.DefinitionName'], 'coreclr-outerloop') }}:
243           testGroup: outerloop
244         ${{ if eq(variables['Build.DefinitionName'], 'coreclr-outerloop-jitminopts-jitstress1-jitstress2') }}:
245           testGroup: outerloop-jitminopts-jitstress1-jitstress2
246         ${{ if eq(variables['Build.DefinitionName'], 'coreclr-outerloop-jitstressregs') }}:
247           testGroup: outerloop-jitstressregs
248         ${{ if eq(variables['Build.DefinitionName'], 'coreclr-outerloop-jitstress2-jitstressregs') }}:
249           testGroup: outerloop-jitstress2-jitstressregs
250         ${{ if eq(variables['Build.DefinitionName'], 'coreclr-outerloop-gcstress0x3-gcstress0xc') }}:
251           testGroup: outerloop-gcstress0x3-gcstress0xc
252
253 # CI
254 - ${{ if and(eq(variables['System.TeamProject'], 'public'), in(variables['Build.Reason'], 'IndividualCI', 'BatchedCI')) }}:
255   - template: eng/platform-matrix.yml
256     parameters:
257       jobTemplate: test-job.yml
258       buildConfig: checked
259       jobParameters:
260         testGroup: outerloop
261
262   - template: eng/platform-matrix.yml
263     parameters:
264       jobTemplate: test-job.yml
265       buildConfig: checked
266       jobParameters:
267         readyToRun: true
268         testGroup: outerloop
269
270 #
271 # Release test builds
272 #
273
274 # Pull-Request test
275 - ${{ if and(eq(variables['System.TeamProject'], 'public'), eq(variables['Build.Reason'], 'PullRequest'), eq(variables['Build.DefinitionName'], 'coreclr-ci')) }}:
276   - template: eng/platform-matrix.yml
277     parameters:
278       jobTemplate: test-job.yml
279       buildConfig: release
280       platforms:
281       - Linux_musl_x64
282       jobParameters:
283         testGroup: innerloop
284
285 # Official test
286 - ${{ if and(eq(variables['System.TeamProject'], 'internal'), ne(variables['Build.Reason'], 'PullRequest')) }}:
287   - template: eng/platform-matrix.yml
288     parameters:
289       jobTemplate: test-job.yml
290       buildConfig: release
291       jobParameters:
292         testGroup: outerloop
293
294   - template: eng/platform-matrix.yml
295     parameters:
296       jobTemplate: test-job.yml
297       buildConfig: release
298       jobParameters:
299         testGroup: outerloop
300         readyToRun: true
301
302
303 # Publish build information to Build Assets Registry
304
305 # This job gathers build assets from the pipeline (from each official
306 # product build job), and publishes them to the build assets
307 # registry. Its dependencies should be updated to include all of the
308 # official builds if we add more platform/arch combinations.
309
310 - ${{ if and(eq(variables['System.TeamProject'], 'internal'), ne(variables['Build.Reason'], 'PullRequest')) }}:
311   - template: /eng/finalize-publish.yml
312     parameters:
313       dependsOn:
314       - build_Linux_arm_release
315       - build_Linux_arm64_release
316       - build_Linux_musl_x64_release
317       - build_Linux_musl_arm64_release
318       - build_Linux_rhel6_x64_release
319       - build_Linux_x64_release
320       - build_OSX_x64_release
321       - build_Windows_NT_x64_release
322       - build_Windows_NT_x86_release
323       - build_Windows_NT_arm_release
324       - build_Windows_NT_arm64_release