102 lines
3.7 KiB
YAML
102 lines
3.7 KiB
YAML
parameters:
|
|
agentOs: ''
|
|
queue: {}
|
|
variables: {}
|
|
|
|
phases:
|
|
- template: /eng/common/templates/phases/base.yml
|
|
parameters:
|
|
name: ${{ parameters.agentOs }}
|
|
enableTelemetry: true
|
|
enableMicrobuild: true
|
|
publicBuildReasons: PullRequest
|
|
queue: ${{ parameters.queue }}
|
|
variables:
|
|
${{ insert }}: ${{ parameters.variables }}
|
|
_AgentOSName: ${{ parameters.agentOs }}
|
|
_HelixType: build/product
|
|
_HelixBuildConfig: $(_BuildConfig)
|
|
BuildConfig: $(_BuildConfig)
|
|
BuildArchitecture: $(_BuildArchitecture)
|
|
_HelixSource: pr/dotnet/core-sdk/$(Build.SourceBranch)
|
|
DockerParameter: $(_DockerParameter)
|
|
LinuxPortable: $(_LinuxPortable)
|
|
RuntimeId: $(_RuntimeIdentifier)
|
|
AdditionalBuildParameters: $(_AdditionalBuildParameters)
|
|
|
|
steps:
|
|
- script: 'eng\setbuildinfo.bat $(BuildArchitecture) $(BuildConfig)'
|
|
condition: eq(variables['_AgentOSName'], 'Windows_NT')
|
|
displayName: Set test info (Windows)
|
|
- script: 'eng/setbuildinfo.sh $(BuildArchitecture) $(BuildConfig)'
|
|
condition: ne(variables['_AgentOSName'], 'Windows_NT')
|
|
displayName: Set test info (Non-Windows)
|
|
- script: 'echo TestParameter: $(TestParameter)'
|
|
displayName: Show TestParameter
|
|
- script: 'echo RunTests: $(RunTests)'
|
|
displayName: Show RunTests
|
|
- script: 'echo AdditionalBuildParameters: $(AdditionalBuildParameters)'
|
|
displayName: Show AdditionalBuildParameters
|
|
- ${{ if eq(parameters.agentOs, 'Windows_NT') }}:
|
|
- script: build.cmd
|
|
$(TestParameter)
|
|
-pack -publish
|
|
-Configuration $(BuildConfig)
|
|
-Architecture $(BuildArchitecture)
|
|
$(AdditionalBuildParameters)
|
|
displayName: Build
|
|
env:
|
|
DOTNET_CLI_UI_LANGUAGE: $(_DOTNET_CLI_UI_LANGUAGE)
|
|
DropSuffix: $(_DropSuffix)
|
|
|
|
- ${{ if eq(parameters.agentOs, 'Linux') }}:
|
|
- script: ./build.sh
|
|
$(TestParameter)
|
|
--pack --publish
|
|
--noprettyprint
|
|
--configuration $(BuildConfig)
|
|
$(DockerParameter)
|
|
--architecture $(BuildArchitecture)
|
|
$(LinuxPortable)
|
|
$(RuntimeId)
|
|
$(AdditionalBuildParameters)
|
|
displayName: Build
|
|
env:
|
|
DropSuffix: $(_DropSuffix)
|
|
|
|
- ${{ if eq(parameters.agentOs, 'Darwin') }}:
|
|
- script: ./build.sh
|
|
$(TestParameter)
|
|
--pack --publish
|
|
--noprettyprint
|
|
--configuration $(BuildConfig)
|
|
displayName: Build
|
|
|
|
- task: PublishTestResults@1
|
|
displayName: Publish Test Results
|
|
inputs:
|
|
testRunner: XUnit
|
|
testResultsFiles: 'artifacts/TestResults/$(_BuildConfig)/*.xml'
|
|
testRunTitle: '$(_AgentOSName)_$(Agent.JobName)'
|
|
platform: '$(BuildPlatform)'
|
|
configuration: '$(_BuildConfig)'
|
|
condition: and(succeededOrFailed(), ne(variables['PB_SkipTests'], 'true'), ne(variables['RunTests'], 'false'))
|
|
- task: CopyFiles@2
|
|
displayName: Gather Logs
|
|
inputs:
|
|
SourceFolder: '$(Build.SourcesDirectory)'
|
|
Contents: |
|
|
artifacts/log/$(_BuildConfig)/**/*
|
|
artifacts/TestResults/$(_BuildConfig)/**/*
|
|
TargetFolder: '$(Build.ArtifactStagingDirectory)'
|
|
continueOnError: true
|
|
condition: always()
|
|
|
|
- task: PublishBuildArtifacts@1
|
|
displayName: Publish Logs to VSTS
|
|
inputs:
|
|
PathtoPublish: '$(Build.ArtifactStagingDirectory)'
|
|
ArtifactName: '$(_AgentOSName)_$(Agent.JobName)_$(Build.BuildNumber)'
|
|
publishLocation: Container
|
|
continueOnError: true
|
|
condition: always()
|