Skip to content

Commit 5fde6ed

Browse files
authored
[10.0.1xx-preview4] Consolidate UB and SB pipelines (#48703)
1 parent afd5beb commit 5fde6ed

File tree

10 files changed

+436
-406
lines changed

10 files changed

+436
-406
lines changed

eng/pipelines/templates/jobs/source-only-build-and-validate.yml

Lines changed: 0 additions & 96 deletions
This file was deleted.

eng/pipelines/templates/jobs/vmr-build.yml

Lines changed: 2 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -69,12 +69,6 @@ parameters:
6969
type: object
7070
default: ''
7171

72-
# Names of jobs that this job depends on. This only provides a job dependency and does not automatically
73-
# download artifacts from the other job. Use reuseBuildArtifactsFrom for that.
74-
- name: dependsOn
75-
type: object
76-
default: ''
77-
7872
#### SOURCE-ONLY parameters ####
7973

8074
# Instead of building the VMR directly, exports the sources into a tarball and builds from that
@@ -91,10 +85,6 @@ parameters:
9185
type: boolean
9286
default: false
9387

94-
- name: excludeOmniSharpTests
95-
type: boolean
96-
default: false
97-
9888
# Allow downloading artifacts from the internet during the build
9989
- name: runOnline
10090
type: boolean
@@ -154,7 +144,7 @@ jobs:
154144
image: ${{ parameters.container.image }}
155145
options: $(defaultContainerOptions)
156146

157-
${{ if or(ne(parameters.reuseBuildArtifactsFrom, ''), ne(parameters.dependsOn, '')) }}:
147+
${{ if ne(parameters.reuseBuildArtifactsFrom, '') }}:
158148
${{ if eq(parameters.buildPass, '') }}:
159149
# For PR builds, skip the stage 2 build if the stage 1 build fails.
160150
# Otherwise, run the stage 2 build even if the stage 1 build fails so that we can get a complete assessment of the build status.
@@ -168,8 +158,6 @@ jobs:
168158
dependsOn:
169159
- ${{ if ne(parameters.reuseBuildArtifactsFrom, '') }}:
170160
- ${{ parameters.reuseBuildArtifactsFrom }}
171-
- ${{ if ne(parameters.dependsOn, '') }}:
172-
- ${{ parameters.dependsOn }}
173161
variables:
174162
- ${{ if eq(variables['System.TeamProject'], 'internal') }}:
175163
- group: AzureDevOps-Artifact-Feeds-Pats
@@ -613,7 +601,7 @@ jobs:
613601
if [[ '${{ parameters.enablePoison }}' == 'True' ]]; then
614602
customBuildArgs="$customBuildArgs --poison"
615603
fi
616-
customBuildArgs="$customBuildArgs --source-only /p:SourceBuildTestsExcludeOmniSharpTests=${{ parameters.excludeOmniSharpTests }}"
604+
customBuildArgs="$customBuildArgs --source-only"
617605
fi
618606
619607
if [[ -n "${{ parameters.targetRid }}" ]]; then
Lines changed: 242 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,242 @@
1+
parameters:
2+
- name: isBuiltFromVmr
3+
type: boolean
4+
default: false
5+
6+
- name: pool_Linux
7+
type: object
8+
9+
- name: pool_LinuxArm64
10+
type: object
11+
12+
# Scope of jobs which are executed
13+
- name: scope
14+
type: string
15+
16+
- name: useMicrosoftBuildAssetsForTests
17+
type: boolean
18+
19+
- name: legs
20+
type: object
21+
22+
stages:
23+
- stage: VMR_SourceOnly_Build
24+
displayName: VMR Source-Only Build
25+
dependsOn: []
26+
variables:
27+
- template: ../variables/vmr-build.yml
28+
parameters:
29+
vmrBranch: ${{ variables.VmrBranch }}
30+
buildSourceOnly: true
31+
jobs:
32+
- ${{ each leg in parameters.legs }}:
33+
- template: ../jobs/vmr-build.yml
34+
parameters:
35+
# CentOS
36+
${{ if eq(leg.distro, 'centos') }}:
37+
buildName: ${{ format(leg.buildNameFormat, variables.centOSStreamName) }}
38+
container:
39+
name: ${{ variables.centOSStreamContainerName }}
40+
image: ${{ variables.centOSStreamContainerImage }}
41+
${{ if ne(leg.reuseBuildArtifactsFrom, '') }}:
42+
reuseBuildArtifactsFrom:
43+
- ${{ format(leg.reuseBuildArtifactsFrom, variables.centOSStreamName) }}
44+
${{ if and(contains(leg.buildNameFormat, 'Previous'), eq(leg.targetArchitecture, 'x64')) }}:
45+
artifactsRid: ${{ variables.centOSStreamX64Rid }}
46+
# Fedora
47+
${{ elseif eq(leg.distro, 'fedora') }}:
48+
buildName: ${{ format(leg.buildNameFormat, variables.fedoraName) }}
49+
container:
50+
name: ${{ variables.fedoraContainerName }}
51+
image: ${{ variables.fedoraContainerImage }}
52+
${{ if ne(leg.reuseBuildArtifactsFrom, '') }}:
53+
reuseBuildArtifactsFrom:
54+
- ${{ format(leg.reuseBuildArtifactsFrom, variables.fedoraName) }}
55+
# Ubuntu
56+
${{ elseif eq(leg.distro, 'ubuntu') }}:
57+
buildName: ${{ format(leg.buildNameFormat, variables.ubuntuName) }}
58+
${{ if eq(leg.targetArchitecture, 'arm64') }}:
59+
container:
60+
name: ${{ variables.ubuntuArmContainerName }}
61+
image: ${{ variables.ubuntuArmContainerImage }}
62+
${{ else }}:
63+
container:
64+
name: ${{ variables.ubuntuContainerName }}
65+
image: ${{ variables.ubuntuContainerImage }}
66+
${{ if ne(leg.reuseBuildArtifactsFrom, '') }}:
67+
reuseBuildArtifactsFrom:
68+
- ${{ format(leg.reuseBuildArtifactsFrom, variables.centOSStreamName) }}
69+
# AlmaLinux
70+
${{ elseif eq(leg.distro, 'almalinux') }}:
71+
buildName: ${{ format(leg.buildNameFormat, variables.almaLinuxName) }}
72+
container:
73+
name: ${{ variables.almaLinuxContainerName }}
74+
image: ${{ variables.almaLinuxContainerImage }}
75+
${{ if ne(leg.reuseBuildArtifactsFrom, '') }}:
76+
reuseBuildArtifactsFrom:
77+
- ${{ format(leg.reuseBuildArtifactsFrom, variables.centOSStreamName) }}
78+
targetRid: ${{ variables.almaLinuxX64Rid }}
79+
# Alpine
80+
${{ elseif eq(leg.distro, 'alpine') }}:
81+
buildName: ${{ format(leg.buildNameFormat, variables.alpineName) }}
82+
container:
83+
name: ${{ variables.alpineContainerName }}
84+
image: ${{ variables.alpineContainerImage }}
85+
${{ if ne(leg.reuseBuildArtifactsFrom, '') }}:
86+
reuseBuildArtifactsFrom:
87+
- ${{ format(leg.reuseBuildArtifactsFrom, variables.centOSStreamName) }}
88+
targetRid: ${{ variables.alpineX64Rid }}
89+
90+
isBuiltFromVmr: ${{ parameters.isBuiltFromVmr }}
91+
vmrBranch: ${{ variables.VmrBranch }}
92+
targetArchitecture: ${{ leg.targetArchitecture }}
93+
${{ if eq(leg.targetArchitecture, 'arm64') }}:
94+
pool: ${{ parameters.pool_LinuxArm64 }}
95+
${{ else }}:
96+
pool: ${{ parameters.pool_Linux }}
97+
buildSourceOnly: true
98+
${{ if eq(parameters.useMicrosoftBuildAssetsForTests, false) }}:
99+
runTests: false
100+
extraProperties: "/p:DisableDevBuildAsDefaultForSourceOnly=true"
101+
buildFromArchive: ${{ leg.buildFromArchive }}
102+
runOnline: ${{ leg.runOnline }}
103+
useMonoRuntime: ${{ leg.useMonoRuntime }}
104+
withPreviousSDK: ${{ leg.withPreviousSDK }}
105+
106+
- ${{ if eq(parameters.useMicrosoftBuildAssetsForTests, true) }}:
107+
- stage: VMR_SourceOnly_Validation
108+
displayName: VMR Source-Only Validation
109+
dependsOn:
110+
- VMR_Vertical_Build
111+
- VMR_SourceOnly_Build
112+
variables:
113+
- template: ../variables/vmr-build.yml
114+
parameters:
115+
vmrBranch: ${{ variables.VmrBranch }}
116+
buildSourceOnly: true
117+
jobs:
118+
- ${{ each leg in parameters.legs }}:
119+
- template: ../jobs/vmr-build.yml
120+
parameters:
121+
# CentOS
122+
${{ if eq(leg.distro, 'centos') }}:
123+
buildName: ${{ format(leg.buildNameFormat, variables.centOSStreamName) }}_Validation
124+
container:
125+
name: ${{ variables.centOSStreamContainerName }}
126+
image: ${{ variables.centOSStreamContainerImage }}
127+
# Fedora
128+
${{ elseif eq(leg.distro, 'fedora') }}:
129+
buildName: ${{ format(leg.buildNameFormat, variables.fedoraName) }}_Validation
130+
container:
131+
name: ${{ variables.fedoraContainerName }}
132+
image: ${{ variables.fedoraContainerImage }}
133+
# Ubuntu
134+
${{ elseif eq(leg.distro, 'ubuntu') }}:
135+
buildName: ${{ format(leg.buildNameFormat, variables.ubuntuName) }}_Validation
136+
${{ if eq(leg.targetArchitecture, 'arm64') }}:
137+
container:
138+
name: ${{ variables.ubuntuArmContainerName }}
139+
image: ${{ variables.ubuntuArmContainerImage }}
140+
${{ else }}:
141+
container:
142+
name: ${{ variables.ubuntuContainerName }}
143+
image: ${{ variables.ubuntuContainerImage }}
144+
# AlmaLinux
145+
${{ elseif eq(leg.distro, 'almalinux') }}:
146+
buildName: ${{ format(leg.buildNameFormat, variables.almaLinuxName) }}_Validation
147+
container:
148+
name: ${{ variables.almaLinuxContainerName }}
149+
image: ${{ variables.almaLinuxContainerImage }}
150+
targetRid: ${{ variables.almaLinuxX64Rid }}
151+
# Alpine
152+
${{ elseif eq(leg.distro, 'alpine') }}:
153+
buildName: ${{ format(leg.buildNameFormat, variables.alpineName) }}_Validation
154+
container:
155+
name: ${{ variables.alpineContainerName }}
156+
image: ${{ variables.alpineContainerImage }}
157+
targetRid: ${{ variables.alpineX64Rid }}
158+
159+
isBuiltFromVmr: ${{ parameters.isBuiltFromVmr }}
160+
vmrBranch: ${{ variables.VmrBranch }}
161+
targetArchitecture: ${{ leg.targetArchitecture }}
162+
${{ if eq(leg.targetArchitecture, 'arm64') }}:
163+
pool: ${{ parameters.pool_LinuxArm64 }}
164+
${{ else }}:
165+
pool: ${{ parameters.pool_Linux }}
166+
buildSourceOnly: true
167+
runOnline: ${{ leg.runOnline }}
168+
runTests: true
169+
enablePoison: ${{ leg.enablePoison }}
170+
skipBuild: true
171+
extraProperties: >
172+
/p:DotNetSourceOnlyTestOnly=true
173+
/p:ExtraRestoreSourcePath=$(Pipeline.Workspace)/msft-pkgs
174+
/p:RestoreAdditionalProjectSources=$(Pipeline.Workspace)/msft-pkgs
175+
176+
testInitSteps:
177+
# Ensure the artifacts staging directory exists so that even if no files get placed there, it won't fail
178+
# when publishing the artifacts.
179+
- script: mkdir -p $(artifactsStagingDir)
180+
displayName: Create Artifacts Staging Directory
181+
- ${{ if eq(leg.distro, 'alpine') }}:
182+
- template: ../steps/download-artifacts.yml
183+
parameters:
184+
artifactDescription: Microsoft Linux (musl) Packages
185+
artifactName: AzureLinux_x64_Cross_Alpine_${{ leg.targetArchitecture }}_Artifacts
186+
downloadFilePatterns: packages/Release/Shipping/**
187+
copyDestination: $(Pipeline.Workspace)/msft-pkgs
188+
flattenDirs: true
189+
- ${{ else }}:
190+
- template: ../steps/download-artifacts.yml
191+
parameters:
192+
artifactDescription: Microsoft Linux Packages
193+
artifactName: AzureLinux_x64_Cross_${{ leg.targetArchitecture }}_Artifacts
194+
downloadFilePatterns: packages/Release/Shipping/**
195+
copyDestination: $(Pipeline.Workspace)/msft-pkgs
196+
flattenDirs: true
197+
- template: ../steps/download-artifacts.yml
198+
parameters:
199+
artifactDescription: Microsoft WASM Packages
200+
artifactName: Browser_Shortstack_wasm_Artifacts
201+
downloadFilePatterns: packages/Release/Shipping/**
202+
copyDestination: $(Pipeline.Workspace)/msft-pkgs
203+
flattenDirs: true
204+
- template: ../steps/download-artifacts.yml
205+
parameters:
206+
artifactDescription: Microsoft Windows Packages
207+
artifactName: Windows_x64_Artifacts
208+
downloadFilePatterns: packages/Release/Shipping/**
209+
copyDestination: $(Pipeline.Workspace)/msft-pkgs
210+
flattenDirs: true
211+
- template: ../steps/download-artifacts.yml
212+
parameters:
213+
artifactDescription: Source Build Assets
214+
downloadFilePatterns: assets/Release/**/*.tar.gz
215+
copyDestination: $(Build.SourcesDirectory)/artifacts
216+
${{ if eq(leg.distro, 'centos') }}:
217+
artifactName: ${{ format(leg.buildNameFormat, variables.centOSStreamName) }}_${{ leg.targetArchitecture}}_Artifacts
218+
${{ elseif eq(leg.distro, 'fedora') }}:
219+
artifactName: ${{ format(leg.buildNameFormat, variables.fedoraName) }}_${{ leg.targetArchitecture}}_Artifacts
220+
${{ elseif eq(leg.distro, 'ubuntu') }}:
221+
artifactName: ${{ format(leg.buildNameFormat, variables.ubuntuName) }}_${{ leg.targetArchitecture}}_Artifacts
222+
${{ elseif eq(leg.distro, 'almalinux') }}:
223+
artifactName: ${{ format(leg.buildNameFormat, variables.almaLinuxName) }}_${{ leg.targetArchitecture}}_Artifacts
224+
${{ elseif eq(leg.distro, 'alpine') }}:
225+
artifactName: ${{ format(leg.buildNameFormat, variables.alpineName) }}_${{ leg.targetArchitecture}}_Artifacts
226+
- ${{ if eq(leg.enablePoison, true) }}:
227+
- template: ../steps/download-artifacts.yml
228+
parameters:
229+
artifactDescription: Source Build Poison Report
230+
downloadFilePatterns: BuildLogs/artifacts/prebuilt-report/poison-usage.xml
231+
copyDestination: $(Build.SourcesDirectory)/artifacts/prebuilt-report
232+
flattenDirs: true
233+
${{ if eq(leg.distro, 'centos') }}:
234+
artifactName: ${{ format(leg.buildNameFormat, variables.centOSStreamName) }}_${{ leg.targetArchitecture}}_Artifacts
235+
${{ elseif eq(leg.distro, 'fedora') }}:
236+
artifactName: ${{ format(leg.buildNameFormat, variables.fedoraName) }}_${{ leg.targetArchitecture}}_Artifacts
237+
${{ elseif eq(leg.distro, 'ubuntu') }}:
238+
artifactName: ${{ format(leg.buildNameFormat, variables.ubuntuName) }}_${{ leg.targetArchitecture}}_Artifacts
239+
${{ elseif eq(leg.distro, 'almalinux') }}:
240+
artifactName: ${{ format(leg.buildNameFormat, variables.almaLinuxName) }}_${{ leg.targetArchitecture}}_Artifacts
241+
${{ elseif eq(leg.distro, 'alpine') }}:
242+
artifactName: ${{ format(leg.buildNameFormat, variables.alpineName) }}_${{ leg.targetArchitecture}}_Artifacts

0 commit comments

Comments
 (0)