[CI] Fwd labels and ensure dotnet tests are run when targeting main. (#11068)
* [CI] Fwd labels and ensure dotnet tests are run when targeting main. * Add 'run-dotnet-tests' to the tags to make manuel happy.
This commit is contained in:
Родитель
0db6ec065a
Коммит
119f7dd153
|
@ -594,8 +594,6 @@ steps:
|
|||
timeoutInMinutes: 600
|
||||
enabled: ${{ parameters.runTests }}
|
||||
env:
|
||||
${{ if eq(variables['Build.SourceBranchName'], 'main') }}: # only works if you have a main branch
|
||||
XHARNESS_LABELS: 'run-dotnet-tests'
|
||||
IsPR: $(configuration.IsPR)
|
||||
GITHUB_TOKEN: $(GitHub.Token) # used to filter the tests to be ran
|
||||
BUILD_REVISION: jenkins
|
||||
|
|
|
@ -45,6 +45,20 @@ steps:
|
|||
$ref = $prInfo.base.ref
|
||||
$tags.Add("$ref")
|
||||
|
||||
# decide if we add the run-dotnet-tests label (if not present) this is done only for main
|
||||
# we can use $ref for that :)
|
||||
$xharnessLabels = $prInfo.labels -join ","
|
||||
if ($ref -eq "main" -and -not ("run-dotnet-tests" -in $xharnessLabels)) {
|
||||
$tags.Add("run-dotnet-tests")
|
||||
if ($xharnessLabels -eq "") {
|
||||
$xharnessLabels = "run-dotnet-tests"
|
||||
} else {
|
||||
$xharnessLabels = @($xharnessLabels, "run-dotnet-tests") -join ","
|
||||
}
|
||||
}
|
||||
|
||||
Write-Host "##vso[task.setvariable variable=xharness-labels;isOutput=true]$xharnessLabels"
|
||||
|
||||
# set output variables based on the git labels
|
||||
$labelsOfInterest = @(
|
||||
"build-package",
|
||||
|
|
|
@ -74,6 +74,7 @@ jobs:
|
|||
SkipApiComparison: $[ dependencies.configure.outputs['labels.skip-api-comparison'] ]
|
||||
# set the branch variable name, this is required by jenkins and we have a lot of scripts that depend on it
|
||||
BRANCH_NAME: $(Build.SourceBranchName)
|
||||
XHARNESS_LABELS: $[ dependencies.configure.outputs['labels.xharness-labels'] ]
|
||||
pool:
|
||||
name: $(AgentPoolComputed)
|
||||
demands:
|
||||
|
|
Загрузка…
Ссылка в новой задаче