Nullable: String (#23450)
[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 build (Pull request)
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
103 #
104 # Checked build
105 #
106 - ${{ if eq(variables['System.TeamProject'], 'public') }}:
107   - template: eng/platform-matrix.yml
108     parameters:
109       jobTemplate: build-job.yml
110       buildConfig: checked
111       ${{ if eq(variables['Build.DefinitionName'], 'coreclr-outerloop-gcstress0x3-gcstress0xc') }}:
112         platforms:
113         - Linux_arm
114         - Linux_arm64
115         - Linux_x64
116         - Windows_NT_x64
117         - Windows_NT_x86
118
119 #
120 # Release build (Pull request)
121 #
122 - ${{ if and(eq(variables['System.TeamProject'], 'public'), eq(variables['Build.Reason'], 'PullRequest'), eq(variables['Build.DefinitionName'], 'coreclr-ci')) }}:
123   - template: eng/platform-matrix.yml
124     parameters:
125       jobTemplate: build-job.yml
126       buildConfig: release
127
128 #
129 # Release build (Official build)
130 #
131 - ${{ if and(eq(variables['System.TeamProject'], 'internal'), ne(variables['Build.Reason'], 'PullRequest')) }}:
132   - template: eng/platform-matrix.yml
133     parameters:
134       jobTemplate: build-job.yml
135       buildConfig: release
136       jobParameters:
137         # Publishing packages to blob feeds sometimes takes a long time
138         # due to waiting for an exclusive lock on the feed.
139         # See https://github.com/dotnet/arcade/blob/master/Documentation/CorePackages/AsyncPublishing.md
140         timeoutInMinutes: 120
141
142 #
143 # Checked test builds
144 #
145
146 # The jobs that can be triggered in PR, manually from ADO and that are scheduled
147 - ${{ if and(eq(variables['System.TeamProject'], 'public'), in(variables['Build.Reason'], 'PullRequest', 'Manual', 'Schedule')) }}:
148   - template: eng/platform-matrix.yml
149     parameters:
150       jobTemplate: test-job.yml
151       buildConfig: checked
152       ${{ if eq(variables['Build.DefinitionName'], 'coreclr-outerloop-gcstress0x3-gcstress0xc') }}:
153         platforms:
154         - Linux_arm
155         - Linux_arm64
156         - Linux_x64
157         - Windows_NT_x64
158         - Windows_NT_x86
159       jobParameters:
160         ${{ if eq(variables['Build.DefinitionName'], 'coreclr-ci') }}:
161           testGroup: innerloop
162         ${{ if eq(variables['Build.DefinitionName'], 'coreclr-outerloop') }}:
163           testGroup: outerloop
164         ${{ if eq(variables['Build.DefinitionName'], 'coreclr-outerloop-jitminopts-jitstress1-jitstress2') }}:
165           testGroup: outerloop-jitminopts-jitstress1-jitstress2
166         ${{ if eq(variables['Build.DefinitionName'], 'coreclr-outerloop-jitstressregs') }}:
167           testGroup: outerloop-jitstressregs
168         ${{ if eq(variables['Build.DefinitionName'], 'coreclr-outerloop-jitstress2-jitstressregs') }}:
169           testGroup: outerloop-jitstress2-jitstressregs
170         ${{ if eq(variables['Build.DefinitionName'], 'coreclr-outerloop-gcstress0x3-gcstress0xc') }}:
171           testGroup: outerloop-gcstress0x3-gcstress0xc
172
173 # CI
174 - ${{ if and(eq(variables['System.TeamProject'], 'public'), in(variables['Build.Reason'], 'IndividualCI', 'BatchedCI')) }}:
175   - template: eng/platform-matrix.yml
176     parameters:
177       jobTemplate: test-job.yml
178       buildConfig: checked
179       jobParameters:
180         testGroup: outerloop
181
182   - template: eng/platform-matrix.yml
183     parameters:
184       jobTemplate: test-job.yml
185       buildConfig: checked
186       jobParameters:
187         readyToRun: true
188         testGroup: outerloop
189
190 #
191 # Release test builds
192 #
193
194 # Pull-Request test
195 - ${{ if and(eq(variables['System.TeamProject'], 'public'), eq(variables['Build.Reason'], 'PullRequest'), eq(variables['Build.DefinitionName'], 'coreclr-ci')) }}:
196   - template: eng/platform-matrix.yml
197     parameters:
198       jobTemplate: test-job.yml
199       buildConfig: release
200       platforms:
201       - Linux_musl_x64
202       jobParameters:
203         testGroup: innerloop
204
205 # Official test
206 - ${{ if and(eq(variables['System.TeamProject'], 'internal'), ne(variables['Build.Reason'], 'PullRequest')) }}:
207   - template: eng/platform-matrix.yml
208     parameters:
209       jobTemplate: test-job.yml
210       buildConfig: release
211       jobParameters:
212         testGroup: outerloop
213
214   - template: eng/platform-matrix.yml
215     parameters:
216       jobTemplate: test-job.yml
217       buildConfig: release
218       jobParameters:
219         testGroup: outerloop
220         readyToRun: true
221
222
223 # Publish build information to Build Assets Registry
224
225 # This job gathers build assets from the pipeline (from each official
226 # product build job), and publishes them to the build assets
227 # registry. Its dependencies should be updated to include all of the
228 # official builds if we add more platform/arch combinations.
229
230 - ${{ if and(eq(variables['System.TeamProject'], 'internal'), ne(variables['Build.Reason'], 'PullRequest')) }}:
231   - template: /eng/finalize-publish.yml
232     parameters:
233       dependsOn:
234       - build_Linux_arm_release
235       - build_Linux_arm64_release
236       - build_Linux_musl_x64_release
237       - build_Linux_musl_arm64_release
238       - build_Linux_rhel6_x64_release
239       - build_Linux_x64_release
240       - build_OSX_x64_release
241       - build_Windows_NT_x64_release
242       - build_Windows_NT_x86_release
243       - build_Windows_NT_arm_release
244       - build_Windows_NT_arm64_release