Skip to content

Commit

Permalink
Merge pull request #9355 from tkelman/tk/appveyor-failfast
Browse files Browse the repository at this point in the history
RFC: Fail fast on AppVeyor for repeated commits to the same PR
  • Loading branch information
tkelman committed Dec 15, 2014
2 parents 1d8e162 + 346ebe3 commit f17595d
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 2 deletions.
1 change: 1 addition & 0 deletions appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ cache:
- llvm-3.3-i686-w64-mingw32-juliadeps.7z
- llvm-3.3-x86_64-w64-mingw32-juliadeps.7z
- make-3.81-2-msys-1.0.11-bin.tar.lzma
- jq.exe

build_script:
# Remove C:\MinGW\bin from the path, the version of MinGW installed on
Expand Down
18 changes: 16 additions & 2 deletions contrib/windows/msys_build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,22 @@ cd `dirname "$0"`/../..
# Stop on error
set -e

# Fail fast on AppVeyor if there are newer pending commits in this PR
curlflags="curl --retry 10 -k -L -y 5"
if [ -n "$APPVEYOR_PULL_REQUEST_NUMBER" ]; then
# download a handy cli json parser
if ! [ -e jq.exe ]; then
$curlflags -O 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 Expand Up @@ -61,8 +77,6 @@ case $(uname) in
;;
esac

curlflags="curl --retry 10 -k -L -y 5"

# Download most recent Julia binary for dependencies
if ! [ -e julia-installer.exe ]; then
f=julia-latest-win$bits.exe
Expand Down

0 comments on commit f17595d

Please sign in to comment.