Skip to content

Commit

Permalink
Merge pull request #3866 from ccordoba12/cancel-appveyor-builds
Browse files Browse the repository at this point in the history
PR: Add code to cancel active Appveyor builds in a branch
  • Loading branch information
ccordoba12 authored Dec 20, 2016
2 parents bc1220c + beec411 commit 7d75bec
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,15 @@ environment:
# USE_QT_API: "PyQt4"

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." }
- powershell .\\continuous_integration\\appveyor\\install.ps1
- "SET PATH=%PYTHON%;%PYTHON%\\Scripts;%PYTHON%\\Library\\bin;%PATH%"

Expand Down

0 comments on commit 7d75bec

Please sign in to comment.