2024-03-12 11:16:48 +03:00
|
|
|
#
|
|
|
|
# See https://docs.microsoft.com/azure/devops/pipelines/yaml-schema for reference.
|
|
|
|
#
|
|
|
|
|
|
|
|
variables:
|
|
|
|
- template: /eng/common/templates-official/variables/pool-providers.yml@self
|
|
|
|
- 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
|
2024-04-10 11:58:49 +03:00
|
|
|
- group: DotNet-DevDiv-Insertion-Workflow-Variables
|
|
|
|
- name: _DevDivDropAccessToken
|
|
|
|
value: $(dn-bot-devdiv-drop-rw-code-rw)
|
|
|
|
|
|
|
|
- group: DotNet-Roslyn-Insertion-Variables
|
|
|
|
- name: Razor.GitHubEmail
|
|
|
|
value: dotnet-build-bot@microsoft.com
|
|
|
|
- name: Razor.GitHubToken
|
|
|
|
value: $(AccessToken-dotnet-build-bot-public-repo)
|
|
|
|
- name: Razor.GitHubUserName
|
|
|
|
value: dotnet-build-bot
|
|
|
|
- name: Insertion.CreateDraftPR
|
|
|
|
value: true
|
|
|
|
- name: Insertion.TitlePrefix
|
|
|
|
value: '[Auto Insertion]'
|
|
|
|
- name: Insertion.TitleSuffix
|
|
|
|
value: ''
|
|
|
|
- name: Codeql.Enabled
|
|
|
|
value: true
|
2024-03-12 11:16:48 +03:00
|
|
|
|
|
|
|
trigger:
|
|
|
|
batch: true
|
|
|
|
branches:
|
|
|
|
include:
|
|
|
|
- main
|
|
|
|
- main-vs-deps
|
|
|
|
- release/*
|
|
|
|
- internal/release/3.*
|
|
|
|
|
|
|
|
pr:
|
|
|
|
autoCancel: true
|
|
|
|
branches:
|
|
|
|
include:
|
|
|
|
- '*'
|
|
|
|
|
|
|
|
resources:
|
|
|
|
repositories:
|
|
|
|
- repository: 1ESPipelineTemplates
|
|
|
|
type: git
|
|
|
|
name: 1ESPipelineTemplates/1ESPipelineTemplates
|
|
|
|
ref: refs/tags/release
|
|
|
|
|
|
|
|
extends:
|
|
|
|
template: v1/1ES.Official.PipelineTemplate.yml@1ESPipelineTemplates
|
|
|
|
parameters:
|
|
|
|
featureFlags:
|
|
|
|
autoBaseline: true
|
|
|
|
sdl:
|
|
|
|
sourceAnalysisPool:
|
|
|
|
name: NetCore1ESPool-Svc-Internal
|
2024-04-16 11:32:08 +03:00
|
|
|
image: 1es-windows-2022
|
2024-03-12 11:16:48 +03:00
|
|
|
os: windows
|
2024-06-27 12:19:56 +03:00
|
|
|
tsa:
|
|
|
|
enabled: true
|
|
|
|
configFile: '$(Build.SourcesDirectory)/eng/TSAConfig.gdntsa'
|
2024-03-12 11:16:48 +03:00
|
|
|
pool:
|
|
|
|
name: NetCore1ESPool-Svc-Internal
|
|
|
|
image: windows.vs2022preview.amd64
|
|
|
|
os: windows
|
|
|
|
customBuildTags:
|
|
|
|
- ES365AIMigrationTooling
|
|
|
|
stages:
|
|
|
|
- stage: build
|
|
|
|
displayName: Build
|
|
|
|
jobs:
|
2024-04-10 11:58:49 +03:00
|
|
|
- ${{ if and(notin(variables['Build.Reason'], 'PullRequest'), eq(variables['Build.SourceBranch'], 'refs/heads/main')) }}:
|
2024-03-12 11:16:48 +03:00
|
|
|
- template: /eng/common/templates-official/job/onelocbuild.yml@self
|
|
|
|
parameters:
|
|
|
|
LclSource: lclFilesfromPackage
|
|
|
|
LclPackageId: 'LCL-JUNO-PROD-RAZORTOOL'
|
|
|
|
MirrorRepo: razor
|
|
|
|
|
|
|
|
- template: /eng/common/templates-official/jobs/jobs.yml@self
|
|
|
|
parameters:
|
|
|
|
enablePublishBuildArtifacts: false
|
|
|
|
enablePublishTestResults: false
|
|
|
|
enablePublishUsingPipelines: false
|
|
|
|
enableSourcebuild: true
|
|
|
|
jobs:
|
|
|
|
# Code check
|
2024-04-10 11:58:49 +03:00
|
|
|
- ${{ if in(variables['Build.Reason'], 'PullRequest') }}:
|
2024-03-12 11:16:48 +03:00
|
|
|
- job: Code_check
|
|
|
|
displayName: Code check
|
|
|
|
pool:
|
2024-04-10 11:58:49 +03:00
|
|
|
name: $(DncEngInternalBuildPool)
|
|
|
|
demands: ImageOverride -equals windows.vs2022preview.amd64
|
2024-03-12 11:16:48 +03:00
|
|
|
steps:
|
|
|
|
- task: NuGetCommand@2
|
|
|
|
displayName: 'Clear NuGet caches'
|
|
|
|
condition: succeeded()
|
|
|
|
inputs:
|
|
|
|
command: custom
|
|
|
|
arguments: 'locals all -clear'
|
2024-05-30 10:26:11 +03:00
|
|
|
- task: NuGetAuthenticate@1
|
2024-06-21 12:07:16 +03:00
|
|
|
- powershell: ./restore.cmd -msbuildEngine dotnet -ci; ./eng/scripts/CodeCheck.ps1 -ci
|
2024-03-12 11:16:48 +03:00
|
|
|
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-official/jobs/jobs.yml@self
|
|
|
|
parameters:
|
|
|
|
enablePublishBuildArtifacts: false
|
|
|
|
enablePublishTestResults: true
|
|
|
|
enableTelemetry: true
|
|
|
|
helixRepo: dotnet/razor
|
|
|
|
helixType: build.product/
|
|
|
|
# enableMicrobuild can't be read from a user-defined variable (Azure DevOps limitation)
|
2024-04-10 11:58:49 +03:00
|
|
|
${{ if notin(variables['Build.Reason'], 'PullRequest') }}:
|
2024-03-12 11:16:48 +03:00
|
|
|
enableMicrobuild: true
|
|
|
|
enablePublishBuildAssets: true
|
|
|
|
enablePublishUsingPipelines: true
|
|
|
|
|
|
|
|
jobs:
|
|
|
|
- job: Windows
|
|
|
|
timeoutInMinutes: 120
|
|
|
|
pool:
|
2024-04-10 11:58:49 +03:00
|
|
|
name: $(DncEngInternalBuildPool)
|
|
|
|
demands: ImageOverride -equals windows.vs2022preview.amd64
|
2024-03-12 11:16:48 +03:00
|
|
|
strategy:
|
|
|
|
matrix:
|
2024-04-10 11:58:49 +03:00
|
|
|
release:
|
|
|
|
_BuildConfig: Release
|
|
|
|
${{ if in(variables['Build.Reason'], 'PullRequest') }}:
|
2024-03-12 11:16:48 +03:00
|
|
|
_PublishArgs: ''
|
2024-04-10 11:58:49 +03:00
|
|
|
${{ if notin(variables['Build.Reason'], 'PullRequest') }}:
|
|
|
|
_PublishArgs: /p:DotNetPublishUsingPipelines=true
|
2024-03-12 11:16:48 +03:00
|
|
|
|
|
|
|
variables:
|
|
|
|
- _BuildArgs: ''
|
|
|
|
- XUNIT_LOGS: '$(Build.SourcesDirectory)\artifacts\log\$(_BuildConfig)'
|
|
|
|
- __VSNeverShowWhatsNew: 1
|
|
|
|
|
|
|
|
# Variables for internal Official builds
|
2024-04-10 11:58:49 +03:00
|
|
|
- ${{ if notin(variables['Build.Reason'], 'PullRequest') }}:
|
2024-03-12 11:16:48 +03:00
|
|
|
- _SignType: real
|
|
|
|
- _BuildArgs: /p:DotNetSignType=$(_SignType) /p:TeamName=$(_TeamName)
|
|
|
|
/p:OfficialBuildId=$(Build.BuildNumber)
|
|
|
|
/p:ManifestBuildBranch=$(Build.SourceBranchName)
|
|
|
|
/p:ManifestBuildNumber=$(Build.BuildNumber)
|
|
|
|
/p:VisualStudioDropName=Products/$(System.TeamProject)/$(Build.Repository.Name)/$(Build.SourceBranchName)/$(Build.BuildNumber)
|
|
|
|
/p:GenerateSbom=true
|
|
|
|
|
|
|
|
steps:
|
|
|
|
- task: NuGetCommand@2
|
|
|
|
displayName: 'Clear NuGet caches'
|
|
|
|
condition: succeeded()
|
|
|
|
inputs:
|
|
|
|
command: custom
|
|
|
|
arguments: 'locals all -clear'
|
|
|
|
|
2024-04-10 11:58:49 +03:00
|
|
|
- template: /eng/restore-internal-tools.yml
|
2024-03-12 11:16:48 +03:00
|
|
|
|
|
|
|
- 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
|
|
|
|
|
2024-05-30 10:26:11 +03:00
|
|
|
- task: NuGetAuthenticate@1
|
2024-03-12 11:16:48 +03:00
|
|
|
|
|
|
|
# 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)
|
|
|
|
name: Build
|
|
|
|
displayName: Build and Deploy
|
|
|
|
condition: succeeded()
|
|
|
|
|
|
|
|
- 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()
|
|
|
|
|
|
|
|
- task: 1ES.PublishPipelineArtifact@1
|
|
|
|
inputs:
|
|
|
|
targetPath: artifacts/log/$(_BuildConfig)
|
|
|
|
artifact: $(Agent.Os)_$(Agent.JobName) Attempt $(System.JobAttempt) Logs
|
|
|
|
displayName: Publish Build Artifacts
|
|
|
|
condition: always()
|
|
|
|
|
|
|
|
- task: 1ES.PublishPipelineArtifact@1
|
|
|
|
inputs:
|
|
|
|
targetPath: 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.
|
|
|
|
- task: 1ES.PublishPipelineArtifact@1
|
|
|
|
inputs:
|
|
|
|
targetPath: artifacts\VSSetup\$(_BuildConfig)
|
|
|
|
artifact: VSSetup
|
|
|
|
displayName: Publish VSSetup
|
|
|
|
condition: and(succeeded(), eq(variables['system.pullrequest.isfork'], false), eq(variables['_BuildConfig'], 'Release'))
|
|
|
|
|
|
|
|
- task: 1ES.PublishPipelineArtifact@1
|
|
|
|
inputs:
|
|
|
|
targetPath: 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'))
|
|
|
|
|
|
|
|
- powershell: Write-Host "##vso[task.setvariable variable=VisualStudio.DropName]Products/$(System.TeamProject)/$(Build.Repository.Name)/$(Build.SourceBranchName)/$(Build.BuildNumber)"
|
|
|
|
displayName: Setting VisualStudio.DropName variable
|
|
|
|
|
|
|
|
# Publishes setup VSIXes to a drop.
|
|
|
|
# Note: The insertion tool looks for the display name of this task in the logs.
|
2024-04-10 11:58:49 +03:00
|
|
|
- task: 1ES.MicroBuildVstsDrop@1
|
|
|
|
displayName: Upload VSTS Drop
|
|
|
|
inputs:
|
|
|
|
dropName: $(VisualStudio.DropName)
|
|
|
|
dropFolder: 'artifacts\VSSetup\$(_BuildConfig)\Insertion'
|
|
|
|
accessToken: $(_DevDivDropAccessToken)
|
2024-04-23 10:52:30 +03:00
|
|
|
dropRetentionDays: 90
|
2024-04-10 11:58:49 +03:00
|
|
|
continueOnError: true
|
|
|
|
condition: and(succeeded(), eq(variables['system.pullrequest.isfork'], false), eq(variables['_BuildConfig'], 'Release'))
|
2024-03-12 11:16:48 +03:00
|
|
|
|
|
|
|
# Unix jobs done as a group since they share the same test results format.
|
|
|
|
- template: /eng/common/templates-official/jobs/jobs.yml@self
|
|
|
|
parameters:
|
|
|
|
enablePublishBuildArtifacts: false
|
|
|
|
enablePublishTestResults: true
|
|
|
|
enableTelemetry: true
|
|
|
|
testResultsFormat: xunit
|
|
|
|
helixRepo: dotnet/razor
|
|
|
|
helixType: build.product/
|
|
|
|
jobs:
|
|
|
|
- job: macOS
|
|
|
|
pool:
|
|
|
|
name: Azure Pipelines
|
|
|
|
image: macOS-12
|
|
|
|
os: macOS
|
|
|
|
strategy:
|
|
|
|
matrix:
|
|
|
|
release:
|
|
|
|
_BuildConfig: Release
|
|
|
|
|
|
|
|
variables:
|
|
|
|
- _BuildArgs: ''
|
|
|
|
# Variables for internal Official builds
|
2024-04-10 11:58:49 +03:00
|
|
|
- ${{ if notin(variables['Build.Reason'], 'PullRequest') }}:
|
2024-03-12 11:16:48 +03:00
|
|
|
- _BuildArgs: /p:DotNetPublishUsingPipelines=true
|
|
|
|
/p:OfficialBuildId=$(Build.BuildNumber)
|
|
|
|
|
|
|
|
steps:
|
2024-04-10 11:58:49 +03:00
|
|
|
- task: Bash@3
|
|
|
|
displayName: Setup Private Feeds Credentials
|
|
|
|
inputs:
|
|
|
|
filePath: $(Build.SourcesDirectory)/eng/common/SetupNugetSources.sh
|
|
|
|
arguments: $(Build.SourcesDirectory)/NuGet.config $Token
|
|
|
|
env:
|
|
|
|
Token: $(dn-bot-dnceng-artifact-feeds-rw)
|
2024-05-30 10:26:11 +03:00
|
|
|
- task: NuGetAuthenticate@1
|
2024-03-12 11:16:48 +03:00
|
|
|
|
|
|
|
- script: eng/cibuild.sh
|
|
|
|
--restore
|
|
|
|
--build
|
|
|
|
--pack
|
|
|
|
--publish
|
|
|
|
--configuration $(_BuildConfig)
|
|
|
|
--prepareMachine
|
|
|
|
--test
|
|
|
|
$(_BuildArgs)
|
|
|
|
name: Build
|
|
|
|
displayName: Restore, Build and Test
|
|
|
|
condition: succeeded()
|
|
|
|
|
|
|
|
- task: 1ES.PublishPipelineArtifact@1
|
|
|
|
inputs:
|
|
|
|
targetPath: artifacts/TestResults/$(_BuildConfig)
|
|
|
|
artifact: $(Agent.Os)_$(Agent.JobName) Attempt $(System.JobAttempt) TestResults
|
|
|
|
displayName: Publish Test Results
|
|
|
|
condition: always()
|
|
|
|
|
|
|
|
- job: Linux
|
|
|
|
pool:
|
2024-04-10 11:58:49 +03:00
|
|
|
name: $(DncEngInternalBuildPool)
|
2024-04-16 14:38:13 +03:00
|
|
|
demands: ImageOverride -equals 1es-ubuntu-2004
|
2024-03-12 11:16:48 +03:00
|
|
|
os: linux
|
|
|
|
|
|
|
|
strategy:
|
|
|
|
matrix:
|
|
|
|
release:
|
|
|
|
_BuildConfig: Release
|
|
|
|
|
|
|
|
variables:
|
|
|
|
- LC_ALL: 'en_US.UTF-8'
|
|
|
|
- LANG: 'en_US.UTF-8'
|
|
|
|
- LANGUAGE: 'en_US.UTF-8'
|
|
|
|
- _BuildArgs: ''
|
|
|
|
|
|
|
|
# Variables for internal Official builds
|
2024-04-10 11:58:49 +03:00
|
|
|
- ${{ if notin(variables['Build.Reason'], 'PullRequest') }}:
|
2024-03-12 11:16:48 +03:00
|
|
|
- _BuildArgs: /p:DotNetPublishUsingPipelines=true
|
|
|
|
/p:OfficialBuildId=$(Build.BuildNumber)
|
|
|
|
|
|
|
|
steps:
|
2024-05-30 10:26:11 +03:00
|
|
|
- task: NuGetAuthenticate@1
|
2024-03-12 11:16:48 +03:00
|
|
|
- script: eng/cibuild.sh
|
|
|
|
--restore
|
|
|
|
--build
|
|
|
|
--pack
|
|
|
|
--publish
|
|
|
|
--configuration $(_BuildConfig)
|
|
|
|
--prepareMachine
|
|
|
|
--test
|
|
|
|
$(_BuildArgs)
|
|
|
|
name: Build
|
|
|
|
displayName: Restore, Build and Test
|
|
|
|
condition: succeeded()
|
|
|
|
|
|
|
|
- task: 1ES.PublishPipelineArtifact@1
|
|
|
|
inputs:
|
|
|
|
targetPath: artifacts/TestResults/$(_BuildConfig)/
|
|
|
|
artifact: $(Agent.Os)_$(Agent.JobName) Attempt $(System.JobAttempt) TestResults
|
|
|
|
displayName: Publish Test Results
|
|
|
|
condition: always()
|
|
|
|
|
2024-04-10 11:58:49 +03:00
|
|
|
- ${{ if notin(variables['Build.Reason'], 'PullRequest') }}:
|
2024-03-12 11:16:48 +03:00
|
|
|
- template: /eng/common/templates-official/post-build/post-build.yml@self
|
|
|
|
parameters:
|
|
|
|
publishingInfraVersion: 3
|
|
|
|
enableSigningValidation: false
|
|
|
|
enableNugetValidation: false
|
|
|
|
SDLValidationParameters:
|
|
|
|
enable: true
|
|
|
|
params: >-
|
|
|
|
-SourceToolsList @("policheck","credscan")
|
|
|
|
-ArtifactToolsList @("binskim")
|
|
|
|
-BinskimAdditionalRunConfigParams @("IgnorePdbLoadError < True","Recurse < True")
|
|
|
|
-TsaInstanceURL $(_TsaInstanceURL)
|
|
|
|
-TsaProjectName $(_TsaProjectName)
|
|
|
|
-TsaNotificationEmail $(_TsaNotificationEmail)
|
|
|
|
-TsaCodebaseAdmin $(_TsaCodebaseAdmin)
|
|
|
|
-TsaBugAreaPath $(_TsaBugAreaPath)
|
|
|
|
-TsaIterationPath $(_TsaIterationPath)
|
|
|
|
-TsaRepositoryName "Razor-Tooling"
|
|
|
|
-TsaCodebaseName "Razor-Tooling"
|
|
|
|
-TsaPublish $True
|
|
|
|
|
|
|
|
- stage: insert
|
|
|
|
dependsOn: publish_using_darc
|
|
|
|
displayName: Insert to VS
|
|
|
|
jobs:
|
|
|
|
- job: insert
|
|
|
|
displayName: Insert to VS
|
|
|
|
pool:
|
|
|
|
name: NetCore1ESPool-Svc-Internal
|
|
|
|
demands: ImageOverride -equals windows.vs2022.amd64
|
|
|
|
steps:
|
|
|
|
- download: current
|
|
|
|
artifact: VSSetup
|
|
|
|
- powershell: |
|
|
|
|
$branchName = "$(Build.SourceBranch)".Substring("refs/heads/".Length)
|
|
|
|
Write-Host "##vso[task.setvariable variable=ComponentBranchName]$branchName"
|
|
|
|
displayName: Get Branch Name
|
|
|
|
- template: /eng/pipelines/insert.yml@self
|
|
|
|
parameters:
|
|
|
|
buildUserName: "dn-bot@microsoft.com"
|
|
|
|
buildPassword: $(dn-bot-devdiv-build-e-code-full-release-e-packaging-r)
|
|
|
|
componentUserName: "dn-bot@microsoft.com"
|
|
|
|
componentPassword: $(dn-bot-dnceng-build-e-code-full-release-e-packaging-r)
|
|
|
|
componentBuildProjectName: internal
|
|
|
|
sourceBranch: "$(ComponentBranchName)"
|
|
|
|
publishDataURI: "https://dev.azure.com/dnceng/internal/_apis/git/repositories/dotnet-razor/items?path=/eng/config/PublishData.json&api-version=6.0"
|
|
|
|
publishDataAccessToken: "$(System.AccessToken)"
|
|
|
|
dropPath: '$(Pipeline.Workspace)\VSSetup'
|