From 827a54c404e67205262e6db032fb2c1a5e6fd097 Mon Sep 17 00:00:00 2001 From: Kai Pastor Date: Tue, 28 Sep 2021 23:00:33 +0200 Subject: [PATCH] [ci] Don't emit warnings for absence of failure logs (#20316) * No warning for absence of failure logs * Update condition for osx and linux Co-authored-by: Billy Robert O'Neal III --- scripts/azure-pipelines/linux/azure-pipelines.yml | 2 +- scripts/azure-pipelines/osx/azure-pipelines.yml | 2 +- scripts/azure-pipelines/test-modified-ports.ps1 | 3 +++ scripts/azure-pipelines/windows/azure-pipelines.yml | 2 +- 4 files changed, 6 insertions(+), 3 deletions(-) diff --git a/scripts/azure-pipelines/linux/azure-pipelines.yml b/scripts/azure-pipelines/linux/azure-pipelines.yml index f68f971e5a..0025750ee2 100644 --- a/scripts/azure-pipelines/linux/azure-pipelines.yml +++ b/scripts/azure-pipelines/linux/azure-pipelines.yml @@ -56,7 +56,7 @@ jobs: inputs: PathtoPublish: '$(Build.ArtifactStagingDirectory)/failure-logs' ArtifactName: 'failure logs for x64-linux' - condition: always() + condition: ne(variables['FAILURE_LOGS_EMPTY'], 'True') - bash: | python3 scripts/file_script.py /mnt/vcpkg-ci/installed/vcpkg/info/ displayName: 'Build a file list for all packages' diff --git a/scripts/azure-pipelines/osx/azure-pipelines.yml b/scripts/azure-pipelines/osx/azure-pipelines.yml index 154247da47..aa5884f0b6 100644 --- a/scripts/azure-pipelines/osx/azure-pipelines.yml +++ b/scripts/azure-pipelines/osx/azure-pipelines.yml @@ -50,7 +50,7 @@ jobs: inputs: PathtoPublish: '$(Build.ArtifactStagingDirectory)/failure-logs' ArtifactName: 'failure logs for x64-osx' - condition: always() + condition: ne(variables['FAILURE_LOGS_EMPTY'], 'True') - bash: | python3 scripts/file_script.py /Users/vagrant/Data/installed/vcpkg/info/ displayName: 'Build a file list for all packages' diff --git a/scripts/azure-pipelines/test-modified-ports.ps1 b/scripts/azure-pipelines/test-modified-ports.ps1 index 8212509d01..d55c6f629a 100755 --- a/scripts/azure-pipelines/test-modified-ports.ps1 +++ b/scripts/azure-pipelines/test-modified-ports.ps1 @@ -137,6 +137,9 @@ else & "./vcpkg$executableExtension" ci $Triplet --x-xunit=$xmlFile --exclude=$skipList --failure-logs=$failureLogs @commonArgs } +$failureLogsEmpty = ((Test-Path $failureLogs) -and (Get-ChildItem $failureLogs).count -eq 0) +Write-Host "##vso[task.setvariable variable=FAILURE_LOGS_EMPTY]$failureLogsEmpty" + if ($LASTEXITCODE -ne 0) { throw "vcpkg ci failed" diff --git a/scripts/azure-pipelines/windows/azure-pipelines.yml b/scripts/azure-pipelines/windows/azure-pipelines.yml index d341a7a9de..60ba6fa1b8 100644 --- a/scripts/azure-pipelines/windows/azure-pipelines.yml +++ b/scripts/azure-pipelines/windows/azure-pipelines.yml @@ -115,7 +115,7 @@ jobs: inputs: PathtoPublish: '$(Build.ArtifactStagingDirectory)\failure-logs' ArtifactName: 'failure logs for ${{ parameters.triplet }}' - condition: always() + condition: ne(variables['FAILURE_LOGS_EMPTY'], 'True') - task: PowerShell@2 displayName: 'Build a file list for all packages' condition: always()