From b5411d19fce8ed4574915bf0a378777d6189fa3b Mon Sep 17 00:00:00 2001 From: Guilherme Branco Stracini Date: Sat, 12 Oct 2024 00:38:31 +0100 Subject: [PATCH] Update appveyor.yml --- appveyor.yml | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/appveyor.yml b/appveyor.yml index a9fa94808..215df119f 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -22,6 +22,17 @@ init: - SET JAVA_HOME=C:\Program Files\Java\jdk19 - SET PATH=%JAVA_HOME%\bin;%PATH% +install: + # If a newer build is queued for the same PR, cancel this one. + # The AppVeyor 'rollout builds' option is supposed to serve the same + # purpose, but it is problematic because it tends to cancel builds pushed + # directly to main/master instead of just PR builds (or the converse). + # credits: JuliaLang developers. + - ps: if ($env:APPVEYOR_PULL_REQUEST_NUMBER -and $env:APPVEYOR_BUILD_NUMBER -ne ((Invoke-RestMethod ` + https://ci.appveyor.com/api/projects/$env:APPVEYOR_ACCOUNT_NAME/$env:APPVEYOR_PROJECT_SLUG/history?recordsNumber=50).builds | ` + Where-Object pullRequestId -eq $env:APPVEYOR_PULL_REQUEST_NUMBER)[0].buildNumber) { ` + throw "There are newer queued builds for this pull request, failing early." } + before_build: - ps: $env:SOLUTION_NAME = $([io.path]::GetFileNameWithoutExtension($(Get-ChildItem -Path .\* -Include *.sln))) - ps: $env:SONAR_PROJECT = "$env:APPVEYOR_REPO_NAME" -replace "/","_"