aspnetcore-tooling/azure-pipelines.yml

288 строки
9.0 KiB
YAML

#
# See https://docs.microsoft.com/azure/devops/pipelines/yaml-schema for reference.
#
variables:
- template: /eng/common/templates/variables/pool-providers.yml
- name: Build.Repository.Clean
value: true
- name: _TeamName
value: AspNetCore
- name: DOTNET_SKIP_FIRST_TIME_EXPERIENCE
value: true
- name: LogLevel
value: 'All'
- name: RunIntegrationTests
value: false
- name: _InternalRuntimeDownloadArgs
value: ''
- name: Codeql.Enabled
value: false
- name: Codeql.SkipTaskAutoInjection
value: true
trigger:
batch: true
branches:
include:
- main
- main-vs-deps
- release/*
- internal/release/3.*
pr:
autoCancel: true
branches:
include:
- '*'
stages:
- stage: build
displayName: Build
jobs:
- template: /eng/common/templates/jobs/jobs.yml
parameters:
enablePublishBuildArtifacts: false
enablePublishTestResults: false
enablePublishUsingPipelines: false
enableSourcebuild: true
jobs:
# Code check
- job: Code_check
displayName: Code check
pool:
name: $(DncEngPublicBuildPool)
demands: ImageOverride -equals windows.vs2022preview.amd64.open
steps:
- task: NuGetCommand@2
displayName: 'Clear NuGet caches'
condition: succeeded()
inputs:
command: custom
arguments: 'locals all -clear'
- powershell: ./restore.cmd -msbuildEngine dotnet -ci $(_InternalRuntimeDownloadArgs); ./eng/scripts/CodeCheck.ps1 -ci
displayName: Run eng/scripts/CodeCheck.ps1
# Windows based jobs. This needs to be separate from Unix based jobs because it generates
# TRX files. That can only be toggled at the top level template level, not at the individual
# job.
- template: /eng/common/templates/jobs/jobs.yml
parameters:
enablePublishBuildArtifacts: false
enablePublishTestResults: true
enableTelemetry: true
helixRepo: dotnet/razor
helixType: build.product/
jobs:
- job: Windows
timeoutInMinutes: 120
pool:
name: $(DncEngPublicBuildPool)
demands: ImageOverride -equals windows.vs2022preview.amd64.open
strategy:
matrix:
debug:
_BuildConfig: Debug
_PublishArgs: ''
release:
_BuildConfig: Release
_PublishArgs: ''
variables:
- _BuildArgs: ''
- XUNIT_LOGS: '$(Build.SourcesDirectory)\artifacts\log\$(_BuildConfig)'
- __VSNeverShowWhatsNew: 1
steps:
- task: NuGetCommand@2
displayName: 'Clear NuGet caches'
condition: succeeded()
inputs:
command: custom
arguments: 'locals all -clear'
- powershell: ./eng/scripts/InstallProcDump.ps1
displayName: Install ProcDump
- powershell: ./eng/scripts/StartDumpCollectionForHangingBuilds.ps1
$(ProcDumpPath)procdump.exe artifacts/log/$(_BuildConfig)
(Get-Date).AddMinutes(60)
devenv, xunit.console, xunit.console.x86
displayName: Start background dump collection
# Don't create a binary log until we can customize the name
# https://github.com/dotnet/arcade/pull/12988
- script: eng\cibuild.cmd
-configuration $(_BuildConfig)
-msbuildEngine vs
-prepareMachine
-restore
-nobl
name: Restore
displayName: Restore
condition: succeeded()
- powershell: eng\SetupVSHive.ps1
displayName: Setup VS Hive
- script: eng\cibuild.cmd
-configuration $(_BuildConfig)
-msbuildEngine vs
-prepareMachine
-build
-pack
-publish
-sign
$(_BuildArgs)
$(_PublishArgs)
$(_InternalRuntimeDownloadArgs)
name: Build
displayName: Build and Deploy
condition: succeeded()
# Needed for Microsoft.AspNetCore.Razor.Microbenchmarks.Generator tests
- task: UseDotNet@2
displayName: 'Install .NET 8 runtime'
inputs:
packageType: runtime
version: 8.x
installationPath: '$(Build.SourcesDirectory)\.dotnet'
- script: eng\CIBuild.cmd
-configuration $(_BuildConfig)
-prepareMachine
-test
-nobl
name: Run_Unit_Tests
displayName: Run Unit Tests
condition: and(succeeded(), in(variables['Build.Reason'], 'PullRequest'))
- script: eng\CIBuild.cmd
-configuration $(_BuildConfig)
-prepareMachine
-integrationTest
name: Run_Integration_Tests
displayName: Run Integration Tests
condition: and(eq(variables['RunIntegrationTests'], true), succeeded(), in(variables['Build.Reason'], 'PullRequest'))
- powershell: ./eng/scripts/FinishDumpCollectionForHangingBuilds.ps1 artifacts/log/$(_BuildConfig)
displayName: Finish background dump collection
continueOnError: true
condition: always()
- publish: artifacts/log/$(_BuildConfig)
artifact: $(Agent.Os)_$(Agent.JobName) Attempt $(System.JobAttempt) Logs
displayName: Publish Build Artifacts
condition: always()
- publish: artifacts/TestResults/$(_BuildConfig)
artifact: $(Agent.Os)_$(Agent.JobName) Attempt $(System.JobAttempt) TestResults
displayName: Publish Test Artifacts
condition: in(variables['Build.Reason'], 'PullRequest')
# Publish an artifact that the RoslynInsertionTool is able to find by its name.
- publish: artifacts\VSSetup\$(_BuildConfig)
artifact: VSSetup
displayName: Publish VSSetup
condition: and(succeeded(), eq(variables['system.pullrequest.isfork'], false), eq(variables['_BuildConfig'], 'Release'))
- publish: artifacts\packages\$(_BuildConfig)
artifact: Packages_$(Agent.Os)_$(_BuildConfig)
displayName: Publish package artifacts
condition: and(succeeded(), eq(variables['system.pullrequest.isfork'], false), eq(variables['_BuildConfig'], 'Release'))
# Unix jobs done as a group since they share the same test results format.
- template: /eng/common/templates/jobs/jobs.yml
parameters:
enablePublishBuildArtifacts: false
enablePublishTestResults: true
enableTelemetry: true
testResultsFormat: xunit
helixRepo: dotnet/razor
helixType: build.product/
jobs:
- job: macOS
pool:
vmImage: macOS-12
strategy:
matrix:
release:
_BuildConfig: Release
debug:
_BuildConfig: Debug
variables:
- _BuildArgs: ''
steps:
- script: eng/cibuild.sh
--restore
--build
--pack
--publish
--configuration $(_BuildConfig)
--prepareMachine
--test
$(_BuildArgs)
$(_InternalRuntimeDownloadArgs)
name: Build
displayName: Restore, Build and Test
condition: succeeded()
- publish: artifacts/log/$(_BuildConfig)
artifact: $(Agent.Os)_$(Agent.JobName) Attempt $(System.JobAttempt) Logs
displayName: Publish Build Artifacts
condition: always()
- publish: artifacts/TestResults/$(_BuildConfig)
artifact: $(Agent.Os)_$(Agent.JobName) Attempt $(System.JobAttempt) TestResults
displayName: Publish Test Results
condition: always()
- job: Linux
container:
image: mcr.microsoft.com/dotnet-buildtools/prereqs:cbl-mariner-2.0
options: --init # This ensures all the stray defunct processes are reaped.
pool:
name: NetCore-Public
demands: ImageOverride -equals Build.Ubuntu.2004.Amd64.Open
strategy:
matrix:
release:
_BuildConfig: Release
debug:
_BuildConfig: Debug
variables:
- LC_ALL: 'en_US.UTF-8'
- LANG: 'en_US.UTF-8'
- LANGUAGE: 'en_US.UTF-8'
- _BuildArgs: ''
steps:
- script: eng/cibuild.sh
--restore
--build
--pack
--publish
--configuration $(_BuildConfig)
--prepareMachine
--test
$(_BuildArgs)
$(_InternalRuntimeDownloadArgs)
name: Build
displayName: Restore, Build and Test
condition: succeeded()
- publish: artifacts/log/$(_BuildConfig)
artifact: $(Agent.Os)_$(Agent.JobName) Attempt $(System.JobAttempt) Logs
displayName: Publish Build Artifacts
condition: always()
- publish: artifacts/TestResults/$(_BuildConfig)/
artifact: $(Agent.Os)_$(Agent.JobName) Attempt $(System.JobAttempt) TestResults
displayName: Publish Test Results
condition: always()