Implement fail-fast for Travis as well
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40
diff --git a/script/cibuild.sh b/script/cibuild.sh
index 8983dcc..82cf725 100755
--- a/script/cibuild.sh
+++ b/script/cibuild.sh
@@ -1,5 +1,15 @@
#!/bin/sh
+# Fail fast for superseded builds to PR's
+if ! [ "$TRAVIS_PULL_REQUEST" = "false" ]; then
+ if ! [ \"$TRAVIS_BUILD_NUMBER\" = $(curl -H "Accept: application/vnd.travis-ci.2+json" \
+ https://api.travis-ci.org/repos/libgit2/libgit2/builds?event_type=pull_request | \
+ jq ".builds | map(select(.pull_request_number == $TRAVIS_PULL_REQUEST))[0].number") ]; then
+ echo "There are newer queued builds for this pull request, failing early."
+ exit 1
+ fi
+fi
+
if [ -n "$COVERITY" ];
then
./script/coverity.sh;
diff --git a/script/install-deps-linux.sh b/script/install-deps-linux.sh
index 347922b..3eb57ce 100755
--- a/script/install-deps-linux.sh
+++ b/script/install-deps-linux.sh
@@ -3,4 +3,4 @@
set -x
sudo apt-get -qq update &&
-sudo apt-get -qq install cmake libssh2-1-dev openssh-client openssh-server
+sudo apt-get -qq install cmake libssh2-1-dev openssh-client openssh-server jq
diff --git a/script/install-deps-osx.sh b/script/install-deps-osx.sh
index c2e0162..ad6a7b4 100755
--- a/script/install-deps-osx.sh
+++ b/script/install-deps-osx.sh
@@ -2,4 +2,4 @@
set -x
-brew install libssh2 cmake
+brew install libssh2 cmake jq