Skip to content

Commit

Permalink
Reverted to original fast-fail for AppVeyor
Browse files Browse the repository at this point in the history
Changes to simplify AppVeyor’s fast-fail solution borrowed from
JuliaLang may not have worked. Reverting to ensure that it is not an
outstanding issue.
  • Loading branch information
kenodegard committed Nov 16, 2016
1 parent 5fc9038 commit 1621597
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions utils/appveyor-killold.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,11 @@
# 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 master instead of just PR builds (or the converse).
# credits: JuliaLang developers.
$_NEWEST = "https://ci.appveyor.com/api/projects/${env:APPVEYOR_ACCOUNT_NAME}/${env:APPVEYOR_PROJECT_SLUG}/history?recordsNumber=50"
$_NEWEST = ((Invoke-RestMethod $_NEWEST).builds | Where-Object pullRequestId)
$_NEWEST = ($_NEWEST -Eq $env:APPVEYOR_PULL_REQUEST_NUMBER)[0].buildNumber
if ($env:APPVEYOR_PULL_REQUEST_NUMBER -And $env:APPVEYOR_BUILD_NUMBER -Ne $_NEWEST) {
# reference:
# JuliaLang developers
# (https://github.com/JuliaLang/Example.jl/commit/8a4959122ce843b3664337c8b5119ce3a968c408)
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."
}

0 comments on commit 1621597

Please sign in to comment.