BuildXL/.azdo/pr/external_pr.yml

122 строки
4.3 KiB
YAML
Исходник Постоянная ссылка Обычный вид История

trigger: none # Explicitly scheduled for PRs
variables:
- group: "BuildXL Common variables"
- name: BuildXL.LogsDirectory.LKG
value: $(Build.SourcesDirectory)\Out\Logs\pr-$(Build.BuildNumber)-lkg
- name: BuildXL.LogsDirectory
value: $(Build.SourcesDirectory)\Out\Logs\pr-$(Build.BuildNumber)
- name: BuildXL.PreReleaseTag
value: pr.public.win
- name: BuildXL.SemanticVersion
value: 0.0.$(Build.BuildNumber)
- name: BuildXL.Configuration
value: Release
# We have a separate pipeline that runs clean builds to get full CodeQL coverage.
- name: Codeql.Enabled
value: "false"
jobs:
- job: Public_Validation
displayName: Public PR Validation
timeoutInMinutes: 120
cancelTimeoutInMinutes: 1
pool:
name: BuildXL-DevOpsAgents-Selfhost
os: windows
steps:
- checkout: self
fetchDepth: 1
fetchTags: false
- template: /.azdo/common/journaling.yml # Enable journaling
# Step 1. Build bits and deploy to dev
- template: /.azdo/common/set-variable-pats.yml
- script: >-
.\bxl.cmd
-minimal
-deploy Dev
-deployconfig Release
-CacheNamespace BuildXL.Public
-SharedCacheMode ConsumeAndPublish
/p:[Sdk.BuildXL]microsoftInternal=1
/q:ReleaseNet8
/p:[BuildXL.Branding]SemanticVersion=$(BuildXL.SemanticVersion)
/p:[BuildXL.Branding]PrereleaseTag=$(BuildXL.PreReleaseTag)
/logOutput:FullOutputOnWarningOrError
/traceInfo:prvalidation=Public
/scrubDirectory:Out\objects
/logsDirectory:$(BuildXL.LogsDirectory.LKG)
/cachemiss:BxlPublicValidation
displayName: BuildXL -Deploy Dev
env:
1ESSHAREDASSETS_BUILDXL_FEED_PAT: $(1ESSHAREDASSETS_BUILDXL_FEED_PAT)
CLOUDBUILD_BUILDXL_SELFHOST_FEED_PAT: $(CLOUDBUILD_BUILDXL_SELFHOST_FEED_PAT)
MSENG_GIT_PAT: $(MSENG_GIT_PAT)
VSTSPERSONALACCESSTOKEN: $(VSTSPERSONALACCESSTOKEN)
ARTIFACT_CREDENTIALPROVIDERS_PATH: $(ARTIFACT_CREDENTIALPROVIDERS_PATH)
CLOUDBUILD_BUILDXL_SELFHOST_FEED_PAT_B64: $(CLOUDBUILD_BUILDXL_SELFHOST_FEED_PAT_B64)
VSS_NUGET_EXTERNAL_FEED_ENDPOINTS: $(VSS_NUGET_EXTERNAL_FEED_ENDPOINTS)
- task: PublishPipelineArtifact@1
displayName: Upload -Deploy Dev logs
condition: always()
continueOnError: True
inputs:
path: $(BuildXL.LogsDirectory.LKG)
artifactName: BuildXL -Deploy Dev logs
# Step 2. Build microsoftInternal=0 using the built bits
- template: /.azdo/common/set-msvc-version.yml
- task: CmdLine@2
displayName: BuildXL -Use Dev (microsoftInternal=0)
inputs:
script: >-
bxl.cmd
-Use Dev
-UseBlobL3
-SharedCacheMode ConsumeAndPublish
-CacheNamespace BuildXL.Public.Validation
/p:[Sdk.BuildXL]microsoftInternal=0
/q:$(BuildXL.Configuration)Net8
/logOutput:FullOutputOnWarningOrError
/p:RetryXunitTests=1
/processRetries:3
/traceInfo:prvalidation=PublicLKG
/p:xunitSemaphoreCount=12
/logsDirectory:$(BuildXL.LogsDirectory)
/scrubDirectory:Out\objects
/pipTimeoutMultiplier:2
# Step 3. Check to see if there are any unstaged files in the build and fail the build.
# We avoid checking cg/nuget/cgmanifest.json, which we expect to change in the external build
- task: PowerShell@2
displayName: Check for unstaged files in the build
inputs:
targetType: inline
continueOnError: true
script: |
$gitStatus = git status --porcelain . -- ':!cg/nuget/cgmanifest.json'
if (-not [string]::IsNullOrWhiteSpace($gitStatus))
{
Write-Host "##vso[task.logissue type=error]There are unstaged files in the build."
Write-Host "##vso[task.logissue type=error]Please commit these files and re-run the validation."
$gitStatus.Split([Environment]::NewLine) | ForEach-Object {
Write-Host "##vso[task.logissue type=error]$($_)"
}
Write-Host "git diff"
git diff
exit 1
}
- task: PublishPipelineArtifact@1
displayName: Upload -Use Dev logs
condition: always()
continueOnError: True
inputs:
path: $(BuildXL.LogsDirectory)
artifactName: BuildXL -Use Dev logs