Skip to content

Commit

Permalink
Move appveyor fast fail from jq to powershell
Browse files Browse the repository at this point in the history
  • Loading branch information
tkelman committed Nov 18, 2015
1 parent 88a9e0a commit 0a11f45
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 16 deletions.
6 changes: 5 additions & 1 deletion appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,13 @@ cache:
- x86_64-4.9.2-release-win32-seh-rt_v4-rev3.7z
- llvm-3.3-i686-w64-mingw32-juliadeps.7z
- llvm-3.3-x86_64-w64-mingw32-juliadeps.7z
- jq.exe

build_script:
# If there's a newer build queued for the same PR, cancel this one
- 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." }
# Remove C:\MinGW\bin from the path, the version of MinGW installed on
# AppVeyor is not compatible with the cross-compiled Julia Windows binaries
- set PATH=%PATH:C:\MinGW\bin;=%
Expand Down
15 changes: 0 additions & 15 deletions contrib/windows/msys_build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -25,21 +25,6 @@ checksum_download() {
deps/jlchecksum "$f"
}

# Fail fast on AppVeyor if there are newer pending commits in this PR
if [ -n "$APPVEYOR_PULL_REQUEST_NUMBER" ]; then
# download a handy cli json parser
if ! [ -e jq.exe ]; then
$curlflags -O http:https://stedolan.github.io/jq/download/win64/jq.exe
fi
av_api_url="https://ci.appveyor.com/api/projects/StefanKarpinski/julia/history?recordsNumber=50"
query=".builds | map(select(.pullRequestId == \"$APPVEYOR_PULL_REQUEST_NUMBER\"))[0].buildNumber"
latestbuild="$(curl $av_api_url | ./jq "$query")"
if [ -n "$latestbuild" -a "$latestbuild" != "null" -a "$latestbuild" != "$APPVEYOR_BUILD_NUMBER" ]; then
echo "There are newer queued builds for this pull request, failing early."
exit 1
fi
fi

# If ARCH environment variable not set, choose based on uname -m
if [ -z "$ARCH" -a -z "$XC_HOST" ]; then
export ARCH=`uname -m`
Expand Down

0 comments on commit 0a11f45

Please sign in to comment.