Add VMR unified build pipelines (#18409)

Contributes to https://github.com/dotnet/source-build/issues/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
This commit is contained in:
Alexander Köplinger 2024-02-06 09:57:00 +01:00 committed by GitHub
commit 28012e74ff
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
15 changed files with 954 additions and 783 deletions

View file

@ -185,6 +185,12 @@ while [[ $# > 0 ]]; do
shift
done
if [[ "$ci" == true ]]; then
if [[ "$exclude_ci_binary_log" == false ]]; then
binary_log=true
fi
fi
. "$scriptroot/eng/common/tools.sh"
function Build {

View file

@ -48,21 +48,17 @@ if ($help) {
exit 0
}
$arguments=""
if ($cleanWhileBuilding) {
$arguments += " /p:CleanWhileBuilding=true"
}
function Build {
InitializeToolset
$bl = if ($binaryLog) { '/bl:' + (Join-Path $LogDir 'Build.binlog') } else { '' }
$cwb = if ($cleanWhileBuilding) { '/p:CleanWhileBuilding=true' } else { '' }
$buildProj = Join-Path $RepoRoot 'build.proj'
MSBuild $buildProj `
$bl `
/p:Configuration=$configuration `
$arguments `
$cwb `
@properties
}
@ -75,6 +71,11 @@ try {
exit 0
}
if ($ci) {
if (-not $excludeCIBinarylog) {
$binaryLog = $true
}
}
Build
}

View file

@ -1,27 +0,0 @@
# 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.
schedules:
- cron: '0 8 * * Mon-Fri'
displayName: Weekday midnight build
branches:
include:
- main
batch: true
trigger:
batch: true
branches:
include:
- release/*
- internal/release/*
pr: none
stages:
- ${{ if ne(variables['Build.Reason'], 'Schedule') }}:
- template: templates/stages/vmr-scan.yml
- template: /src/installer/eng/pipelines/templates/stages/vmr-cross-build.yml
parameters:
isBuiltFromVmr: true
isLiteBuild: false

View file

@ -1,4 +1,8 @@
# This is the dotnet/dotnet-lite pipeline that is triggered by pushes to main and PRs targetting main and release/*.
# This yml is used by these pipelines and triggers:
#
# - dotnet-source-build-lite (internal)
# - PR: release/* and main, lite build
# - CI: main only, every batched commit, lite build
trigger:
batch: true
@ -13,10 +17,11 @@ pr:
- release/*
stages:
- ${{ if and(ne(variables['System.TeamProject'], 'public'), notin(variables['Build.Reason'], 'PullRequest')) }}:
- ${{ if ne(variables['Build.Reason'], 'PullRequest') }}:
- template: templates/stages/vmr-scan.yml
- template: /src/installer/eng/pipelines/templates/stages/vmr-build.yml
parameters:
isBuiltFromVmr: true
isLiteBuild: true
isSourceOnlyBuild: true
scope: lite

View file

@ -1,21 +1,42 @@
# 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.
# This yml is used by these pipelines and triggers:
# NOTE: the triggers are defined in the Azure DevOps UI as they are too complex
#
# - dotnet-source-build (public)
# - PR: ultralite build
# - CI: release/* only, every batched commit, full build
# - Schedule: main only, full build
#
# - dotnet-unified-build (public)
# - PR: lite build
# - CI: release/* only, every batched commit, full build
# - Schedule: main only, full build
#
# - dotnet-source-build (internal)
# - PR: ultralite build
# - CI: release/* and internal/release/* only, every batched commit, full build
# - CI: main only, every batched commit, lite build
# - Schedule: main only, full build
#
# - dotnet-unified-build (internal)
# - PR: lite build
# - CI: release/*, internal/release/* and main, every batched commit, full build
schedules:
- cron: '0 8 * * Mon-Fri'
displayName: Weekday midnight build
branches:
include:
- main
batch: true
variables:
# enable source-only build for pipelines that contain the -source-build string
- name: isSourceOnlyBuild
value: ${{ contains(variables['Build.DefinitionName'], '-source-build') }}
trigger:
batch: true
branches:
include:
- release/*
- internal/release/*
- name: isInternalBuild
value: ${{ eq(variables['System.TeamProject'], 'internal') }}
pr: none
- name: isMainBranch
value: ${{ eq(variables['Build.SourceBranch'], 'refs/heads/main') }}
- name: isScheduleTrigger
value: ${{ eq(variables['Build.Reason'], 'Schedule') }}
- name: isPRTrigger
value: ${{ eq(variables['Build.Reason'], 'PullRequest') }}
stages:
- template: templates/stages/vmr-scan.yml
@ -23,4 +44,14 @@ stages:
- template: /src/installer/eng/pipelines/templates/stages/vmr-build.yml
parameters:
isBuiltFromVmr: true
isLiteBuild: false
isSourceOnlyBuild: ${{ variables.isSourceOnlyBuild }}
${{ if eq(variables.isScheduleTrigger, 'true') }}:
scope: full
${{ elseif and(eq(variables.isPRTrigger, 'true'), eq(variables.isSourceOnlyBuild, 'true')) }}:
scope: ultralite
${{ elseif and(eq(variables.isPRTrigger, 'true'), not(eq(variables.isSourceOnlyBuild, 'true'))) }}:
scope: lite
${{ elseif and(not(eq(variables.isPRTrigger, 'true')), eq(variables.isSourceOnlyBuild, 'true'), eq(variables.isInternalBuild, 'true'), eq(variables.isMainBranch, 'true')) }}:
scope: lite
${{ else }}:
scope: full