From b3801c5bb62ce615ef1e1f6eb985dd1358ef4e56 Mon Sep 17 00:00:00 2001 From: Richard Frank Date: Mon, 7 Mar 2016 10:20:31 -0500 Subject: [PATCH] BLD: Cancel previously queued appveyor builds for a PR --- appveyor.yml | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/appveyor.yml b/appveyor.yml index 94c045f3..eef471a8 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -77,6 +77,16 @@ init: - "ECHO %NUMPY_VERSION%" install: + # If there is a newer build 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 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." } + # Get cygwin's git out of our PATH. See https://github.com/omnia-md/conda-dev-recipes/pull/16/files#diff-180360612c6b8c4ed830919bbb4dd459 - "del C:\\cygwin\\bin\\git.exe" # this installs the appropriate Miniconda (Py2/Py3, 32/64 bit),