Skip to content

Commit 440e81a

Browse files
committed
TST: Fail quickly on AppVeyor for superseded PR builds
1 parent 26af0ce commit 440e81a

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

appveyor.yml

+5
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,11 @@ environment:
1313
PYTHON_ARCH: "x86"
1414

1515
build_script:
16+
# If there's a newer build queued for the same PR, cancel this one
17+
- ps: if ($env:APPVEYOR_PULL_REQUEST_NUMBER -and $env:APPVEYOR_BUILD_NUMBER -ne ((Invoke-RestMethod `
18+
https://ci.appveyor.com/api/projects/$env:APPVEYOR_ACCOUNT_NAME/$env:APPVEYOR_PROJECT_SLUG/history?recordsNumber=50).builds | `
19+
Where-Object pullRequestId -eq $env:APPVEYOR_PULL_REQUEST_NUMBER)[0].buildNumber) { `
20+
throw "There are newer queued builds for this pull request, failing early." }
1621
- ps: Start-FileDownload "https://repo.continuum.io/miniconda/Miniconda$env:PY_MAJOR_VER-latest-Windows-$env:PYTHON_ARCH.exe" C:\Miniconda.exe; echo "Finished downloading miniconda"
1722
- cmd: C:\Miniconda.exe /S /D=C:\Py
1823
- SET PATH=C:\Py;C:\Py\Scripts;C:\Py\Library\bin;%PATH%

0 commit comments

Comments
 (0)