Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
52 changes: 24 additions & 28 deletions eng/pipelines/libraries/.azure-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -82,39 +82,35 @@ variables:
value: .NETCore

stages:
# Windows legs
- template: ${{ variables['pipelinesPath'] }}/windows.yml
parameters:
isOfficialBuild: ${{ and(ne(variables['System.TeamProject'], 'public'), notIn(variables['Build.Reason'], 'PullRequest')) }}
fullMatrix: ${{ notIn(variables['Build.Reason'], 'PullRequest') }}

# Linux legs
- template: ${{ variables['pipelinesPath'] }}/linux.yml
parameters:
isOfficialBuild: ${{ and(ne(variables['System.TeamProject'], 'public'), notIn(variables['Build.Reason'], 'PullRequest')) }}
fullMatrix: ${{ notIn(variables['Build.Reason'], 'PullRequest') }}

# MacOS legs
- template: ${{ variables['pipelinesPath'] }}/macos.yml
parameters:
isOfficialBuild: ${{ and(ne(variables['System.TeamProject'], 'public'), notIn(variables['Build.Reason'], 'PullRequest')) }}
fullMatrix: ${{ notIn(variables['Build.Reason'], 'PullRequest') }}

# FreeBSD leg is only for official builds
# - template: ${{ variables['pipelinesPath'] }}/freebsd.yml
# parameters:
# isOfficialBuild: ${{ and(ne(variables['System.TeamProject'], 'public'), notIn(variables['Build.Reason'], 'PullRequest')) }}
# fullMatrix: ${{ notIn(variables['Build.Reason'], 'PullRequest') }}
- stage: Build
jobs:
- template: /eng/pipelines/coreclr/templates/platform-matrix.yml
parameters:
jobTemplate: /eng/pipelines/libraries/build.yml
buildConfig: Release
platforms:
- Windows_NT_x64
jobParameters:
isOfficialBuild: ${{ variables['isOfficialBuild'] }}

- template: /eng/pipelines/coreclr/templates/platform-matrix.yml
parameters:
jobTemplate: /eng/pipelines/libraries/build.yml
buildConfig: Release
platforms:
- Windows_NT_x64
jobParameters:
isOfficialBuild: ${{ variables['isOfficialBuild'] }}
runTests: true
testScope: innerloop

# Publish and validation steps. Only run in official builds
- ${{ if and(ne(variables['System.TeamProject'], 'public'), notIn(variables['Build.Reason'], 'PullRequest')) }}:
- template: ${{ variables['pipelinesPath'] }}/pre-publish.yml
- ${{ if eq(variables['isOfficialBuild'], 'true') }}:
- template: /eng/pipelines/libraries/pre-publish.yml
parameters:
dependsOn:
- WindowsStage
- LinuxStage
- MacOSStage
# - FreeBSD
- Build

- template: eng\common\templates\post-build\post-build.yml
parameters:
Expand Down
135 changes: 135 additions & 0 deletions eng/pipelines/libraries/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,135 @@
parameters:
buildConfig: ''
osGroup: ''
archType: ''
osSubgroup: ''
framework: netcoreapp
isOfficialBuild: false
timeoutInMinutes: 150
preBuildSteps: []
testScope: ''
publishBinaryArtifacts: false
runTests: false
publishTestArtifacts: false
helixQueues: []
container: ''
crossrootfsDir: ''

jobs:
- template: /eng/common/templates/job/job.yml
parameters:
variables:
- _msbuildCommonParameters: ''
- _finalFrameworkArg: -framework ${{ parameters.framework }}
- _skipTestRestoreArg: /p:SkipTestRestore=true
- _testScopeArg: ''
- _actionParameters: -build

- ${{ if ne(parameters.crossrootfsDir, '') }}:
- ROOTFS_DIR: ${{ parameters.crossrootfsDir}}

- ${{ if ne(parameters.testScope, '') }}:
- _testScopeArg: -testscope ${{ parameters.testScope }}
- _skipTestRestoreArg: ''
- _actionParameters: -buildtests

- ${{ if eq(parameters.framework, 'allConfigurations' ) }}:
- _finalFrameworkArg: -allConfigurations

- ${{ if eq(parameters.isOfficialBuild, true) }}:
- _msbuildCommonParameters: /p:OfficialBuildId=$(Build.BuildNumber)

- _args: -configuration ${{ parameters.buildConfig }} -ci -arch ${{ parameters.archType }} $(_finalFrameworkArg) $(_testScopeArg) $(_skipTestRestoreArg)
- _commonArguments: $(_args)

# Windows variables
- ${{ if eq(parameters.osGroup, 'Windows_NT') }}:
- _buildScript: $(buildScriptFileName).cmd
- _msbuildCommand: powershell -ExecutionPolicy ByPass -NoProfile eng\common\msbuild.ps1 -warnaserror:0 -ci

# Non-Windows variables
- ${{ if ne(parameters.osGroup, 'Windows_NT') }}:
- _buildScript: ./$(buildScriptFileName).sh
- _msbuildCommand: ./eng/common/msbuild.sh --warnaserror false --ci
- ${{ if eq(parameters.isOfficialBuild, true) }}:
- _commonArguments: $(_args) -stripSymbols

- ${{ if or(eq(parameters.runTests, true), eq(parameters.publishTestArtifacts, true)) }}:
- ${{ if ne(parameters.framework, 'allConfigurations') }}:
- _commonArguments: $(_args) /p:ArchiveTests=Tests
- ${{ if eq(parameters.framework, 'allConfigurations') }}:
- _commonArguments: $(_args) /p:ArchiveTests=Packages

enableTelemetry: ${{ parameters.isOfficialBuild }} # TODO: figure out if it's needed
helixRepo: dotnet/runtime

${{ if ne(parameters.container, '') }}:
${{ if eq(parameters.container.registry, 'mcr') }}:
container: ${{ format('{0}:{1}', 'mcr.microsoft.com/dotnet-buildtools/prereqs', parameters.container.image) }}
${{ if ne(parameters.container.registry, 'mcr') }}:
container: ${{ format('{0}:{1}', parameters.container.registry, parameters.container.image) }}

${{ if eq(parameters.testScope, '') }}:
name: ${{ format('libraries_build_{0}_{1}{2}_{3}_{4}', parameters.framework, parameters.osGroup, parameters.osSubgroup, parameters.archType, parameters.buildConfig) }}
${{ if eq(parameters.framework, 'netcoreapp') }}:
displayName: ${{ format('{0}{1} Build {2}_{3}', parameters.osGroup, parameters.osSubgroup, parameters.archType, parameters.buildConfig) }}
${{ if ne(parameters.framework, 'netcoreapp') }}:
displayName: ${{ format('{0} Build {1} {2}_{3}', parameters.osGroup, parameters.framework, parameters.archType, parameters.buildConfig) }}

${{ if ne(parameters.testScope, '') }}:
name: ${{ format('libraries_test_{0}_{1}{2}_{3}_{4}', parameters.framework, parameters.osGroup, parameters.osSubgroup, parameters.archType, parameters.buildConfig) }}
${{ if eq(parameters.framework, 'netcoreapp') }}:
displayName: ${{ format('{0}{1} Test {2}_{3}', parameters.osGroup, parameters.osSubgroup, parameters.archType, parameters.buildConfig) }}
${{ if ne(parameters.framework, 'netcoreapp') }}:
displayName: ${{ format('{0} Test {1} {2}_{3}', parameters.osGroup, parameters.framework, parameters.archType, parameters.buildConfig) }}

${{ if ne(parameters.testScope, '') }}:
dependsOn:
- ${{ format('libraries_build_{0}_{1}{2}_{3}_{4}', parameters.framework, parameters.osGroup, parameters.osSubgroup, parameters.archType, parameters.buildConfig) }}

workspace:
clean: all

enablePublishBuildArtifacts: true
timeoutInMinutes: ${{ parameters.timeoutInMinutes }}

steps:
- ${{ if ne(parameters.preBuildSteps[0], '') }}:
- ${{ parameters.preBuildSteps }}

- script: $(_buildScript) -restore $(_commonArguments)
displayName: Restore

- ${{ if eq(parameters.isOfficialBuild, true) }}:
- task: DotNetCoreCLI@2
displayName: Restore internal tools
condition: and(succeeded(), ne(variables['_skipRestoreInternalTools'], true))
inputs:
command: restore
feedsToUse: config
projects: 'eng/common/internal/Tools.csproj'
nugetConfigPath: 'eng/internal/NuGet.config'
restoreDirectory: '$(Build.SourcesDirectory)\.packages'
verbosityRestore: 'normal'
externalFeedCredentials: 'dotnet-core-internal-tooling'

- script: $(_buildScript)
$(_actionParameters)
$(_commonArguments)
$(_msbuildCommonParameters)
displayName: Build

- ${{ if eq(parameters.runTests, true) }}:
- template: /eng/pipelines/libraries/helix.yml
parameters:
targetOS: ${{ parameters.targetOS }}
archGroup: ${{ parameters.archType }}
configuration: ${{ parameters.buildConfig }}
helixQueues: ${{ join(';', parameters.helixQueues) }}
msbuildScript: $(_msbuildCommand)
framework: ${{ parameters.framework }}
testScope: ${{ parameters.testScope }}
creator: dotnet-bot
helixToken: ''

# TODO: publish test artifacts when publishTestArtifacts == true.
4 changes: 0 additions & 4 deletions eng/pipelines/libraries/helix.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,8 @@ parameters:
creator: ''
framework: ''
helixQueues: ''
helixToken: ''
msbuildScript: ''
targetOS: ''
officialBuildId: ''
testScope: 'innerloop' # innerloop | outerloop | all
condition: always()

Expand All @@ -22,9 +20,7 @@ steps:
/p:TargetGroup=${{ parameters.framework }}
/p:HelixTargetQueues=${{ parameters.helixQueues }}
/p:HelixBuild=$(Build.BuildNumber)
/p:HelixAccessToken=${{ parameters.helixToken }}
/p:Creator=${{ parameters.creator }}
/p:OfficialBuildId=${{ parameters.officialBuildId }}
/bl:$(Build.SourcesDirectory)/artifacts/log/$(_BuildConfig)/SendToHelix.binlog
displayName: Send to Helix
condition: and(succeeded(), ${{ parameters.condition }})
Expand Down
2 changes: 2 additions & 0 deletions eng/pipelines/libraries/variables.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,5 @@ variables:
value: $(Build.SourcesDirectory)/src/libraries
- name: pipelinesPath
value: /eng/pipelines/libraries
- name: isOfficialBuild
value: ${{ and(ne(variables['System.TeamProject'], 'public'), notIn(variables['Build.Reason'], 'PullRequest')) }}
2 changes: 1 addition & 1 deletion src/libraries/build.proj
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
<_RestoreProjects Include="$(MSBuildThisFileDirectory)restore\dirs.proj" Build="true" />
</ItemGroup>

<ItemGroup Condition="'$(DotNetBuildFromSource)' != 'true'">
<ItemGroup Condition="'$(DotNetBuildFromSource)' != 'true' AND '$(SkipTestRestore)' != 'true'">
<_RestoreProjects Include="$(MSBuildThisFileDirectory)tests.proj" Build="false" />
</ItemGroup>

Expand Down