Skip to content

Commit 5530b80

Browse files
authored
Add VMR unified build pipelines (#18409)
Contributes to dotnet/source-build#3823 - Removes and consolidates vmr-cross-build.yml/ci-cross-build.yml POC into vmr-build.yml/ci.yml - Add stage for building vertical/unified build legs into vmr-build.yml - Adds Windows build and handling for Windows/Unix differences
1 parent 8d7a94f commit 5530b80

File tree

5 files changed

+68
-52
lines changed

5 files changed

+68
-52
lines changed

Diff for: src/SourceBuild/content/build.sh

+6
Original file line numberDiff line numberDiff line change
@@ -185,6 +185,12 @@ while [[ $# > 0 ]]; do
185185
shift
186186
done
187187

188+
if [[ "$ci" == true ]]; then
189+
if [[ "$exclude_ci_binary_log" == false ]]; then
190+
binary_log=true
191+
fi
192+
fi
193+
188194
. "$scriptroot/eng/common/tools.sh"
189195

190196
function Build {

Diff for: src/SourceBuild/content/eng/build.ps1

+7-6
Original file line numberDiff line numberDiff line change
@@ -48,21 +48,17 @@ if ($help) {
4848
exit 0
4949
}
5050

51-
$arguments=""
52-
if ($cleanWhileBuilding) {
53-
$arguments += " /p:CleanWhileBuilding=true"
54-
}
55-
5651
function Build {
5752
InitializeToolset
5853

5954
$bl = if ($binaryLog) { '/bl:' + (Join-Path $LogDir 'Build.binlog') } else { '' }
55+
$cwb = if ($cleanWhileBuilding) { '/p:CleanWhileBuilding=true' } else { '' }
6056
$buildProj = Join-Path $RepoRoot 'build.proj'
6157

6258
MSBuild $buildProj `
6359
$bl `
6460
/p:Configuration=$configuration `
65-
$arguments `
61+
$cwb `
6662
@properties
6763
}
6864

@@ -75,6 +71,11 @@ try {
7571
exit 0
7672
}
7773

74+
if ($ci) {
75+
if (-not $excludeCIBinarylog) {
76+
$binaryLog = $true
77+
}
78+
}
7879

7980
Build
8081
}

Diff for: src/SourceBuild/content/eng/pipelines/ci-crossbuild.yml

-27
This file was deleted.

Diff for: src/SourceBuild/content/eng/pipelines/ci-lite.yml

+8-3
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,8 @@
1-
# This is the dotnet/dotnet-lite pipeline that is triggered by pushes to main and PRs targetting main and release/*.
1+
# This yml is used by these pipelines and triggers:
2+
#
3+
# - dotnet-source-build-lite (internal)
4+
# - PR: release/* and main, lite build
5+
# - CI: main only, every batched commit, lite build
26

37
trigger:
48
batch: true
@@ -13,10 +17,11 @@ pr:
1317
- release/*
1418

1519
stages:
16-
- ${{ if and(ne(variables['System.TeamProject'], 'public'), notin(variables['Build.Reason'], 'PullRequest')) }}:
20+
- ${{ if ne(variables['Build.Reason'], 'PullRequest') }}:
1721
- template: templates/stages/vmr-scan.yml
1822

1923
- template: /src/installer/eng/pipelines/templates/stages/vmr-build.yml
2024
parameters:
2125
isBuiltFromVmr: true
22-
isLiteBuild: true
26+
isSourceOnlyBuild: true
27+
scope: lite

Diff for: src/SourceBuild/content/eng/pipelines/ci.yml

+47-16
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,57 @@
1-
# This is the dotnet/dotnet pipeline that is triggered every weekday at midnight PST (08:00 UTC) for "main" and when changes are pushed to release/* and internal/release/* branches.
1+
# This yml is used by these pipelines and triggers:
2+
# NOTE: the triggers are defined in the Azure DevOps UI as they are too complex
3+
#
4+
# - dotnet-source-build (public)
5+
# - PR: ultralite build
6+
# - CI: release/* only, every batched commit, full build
7+
# - Schedule: main only, full build
8+
#
9+
# - dotnet-unified-build (public)
10+
# - PR: lite build
11+
# - CI: release/* only, every batched commit, full build
12+
# - Schedule: main only, full build
13+
#
14+
# - dotnet-source-build (internal)
15+
# - PR: ultralite build
16+
# - CI: release/* and internal/release/* only, every batched commit, full build
17+
# - CI: main only, every batched commit, lite build
18+
# - Schedule: main only, full build
19+
#
20+
# - dotnet-unified-build (internal)
21+
# - PR: lite build
22+
# - CI: release/*, internal/release/* and main, every batched commit, full build
223

3-
schedules:
4-
- cron: '0 8 * * Mon-Fri'
5-
displayName: Weekday midnight build
6-
branches:
7-
include:
8-
- main
9-
batch: true
24+
variables:
25+
# enable source-only build for pipelines that contain the -source-build string
26+
- name: isSourceOnlyBuild
27+
value: ${{ contains(variables['Build.DefinitionName'], '-source-build') }}
1028

11-
trigger:
12-
batch: true
13-
branches:
14-
include:
15-
- release/*
16-
- internal/release/*
29+
- name: isInternalBuild
30+
value: ${{ eq(variables['System.TeamProject'], 'internal') }}
1731

18-
pr: none
32+
- name: isMainBranch
33+
value: ${{ eq(variables['Build.SourceBranch'], 'refs/heads/main') }}
34+
35+
- name: isScheduleTrigger
36+
value: ${{ eq(variables['Build.Reason'], 'Schedule') }}
37+
38+
- name: isPRTrigger
39+
value: ${{ eq(variables['Build.Reason'], 'PullRequest') }}
1940

2041
stages:
2142
- template: templates/stages/vmr-scan.yml
2243

2344
- template: /src/installer/eng/pipelines/templates/stages/vmr-build.yml
2445
parameters:
2546
isBuiltFromVmr: true
26-
isLiteBuild: false
47+
isSourceOnlyBuild: ${{ variables.isSourceOnlyBuild }}
48+
${{ if eq(variables.isScheduleTrigger, 'true') }}:
49+
scope: full
50+
${{ elseif and(eq(variables.isPRTrigger, 'true'), eq(variables.isSourceOnlyBuild, 'true')) }}:
51+
scope: ultralite
52+
${{ elseif and(eq(variables.isPRTrigger, 'true'), not(eq(variables.isSourceOnlyBuild, 'true'))) }}:
53+
scope: lite
54+
${{ elseif and(not(eq(variables.isPRTrigger, 'true')), eq(variables.isSourceOnlyBuild, 'true'), eq(variables.isInternalBuild, 'true'), eq(variables.isMainBranch, 'true')) }}:
55+
scope: lite
56+
${{ else }}:
57+
scope: full

0 commit comments

Comments
 (0)