git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Reducing redundant build at Travis?
@ 2017-07-12 23:44 Junio C Hamano
  2017-07-13 21:21 ` Lars Schneider
  0 siblings, 1 reply; 12+ messages in thread
From: Junio C Hamano @ 2017-07-12 23:44 UTC (permalink / raw)
  To: Lars Schneider; +Cc: git

I usually try to stay as late as possible to finish all the
integration branches in order before pushing out the result; it is
more efficient to be able to batch things (for humans).  

I however noticed that This often means we would have multiple build
jobs at Travis for branches and builds on Windows often fails
waiting for its response.  Since I tagged the tip of 'maint', and I
wanted to give all the build a fair chance to succeed without other
build jobs starving it of resources, I pushed out 'maint' and the
tag before others, even though I already have all the other
integration branches ready.

Unfortunately, https://travis-ci.org/git/git/builds/ shows that it
does not care if it spawned a job to build the tip of 'maint' and
another for 'v2.13.3' that point at the same thing.

I do not mind this behaviour terribly for Linux builds that never
seem to time out, but it is wasteful.  Here is what I came up with
to skip the build and test on a branch tip that is tagged, but I
suspect this would not actually work (when told to build a tag, I
suspect that it would try to find an exact-match and ends up finding
itself, refusing to do the work).

I also do not quite like the way that I had to add a check like this
for every script: thing in the .travis.yml file (the attached does
not even cover MacOS whose build tends to take a lot longer).  I
suspect that you or others who are better versed with the system may
have better idea to have a single centralized check that avoids a
tip of a branch that is pointed at by a release tag.

Thanks.

 ci/run-linux32-build.sh | 6 ++++++
 ci/run-windows-build.sh | 6 ++++++
 2 files changed, 12 insertions(+)

diff --git a/ci/run-linux32-build.sh b/ci/run-linux32-build.sh
index e30fb2cddc..ffb5c8fdf1 100755
--- a/ci/run-linux32-build.sh
+++ b/ci/run-linux32-build.sh
@@ -6,6 +6,12 @@
 #   run-linux32-build.sh [host-user-id]
 #
 
+if TAG=$(git describe --exact-match HEAD 2>/dev/null)
+then
+	echo "The tip of the branch is exactly at $TAG"
+	exit 0
+fi
+
 # Update packages to the latest available versions
 linux32 --32bit i386 sh -c '
     apt update >/dev/null &&
diff --git a/ci/run-windows-build.sh b/ci/run-windows-build.sh
index 2d98f6b2f9..74d4819d74 100755
--- a/ci/run-windows-build.sh
+++ b/ci/run-windows-build.sh
@@ -12,6 +12,12 @@ test -z "$GFW_CI_TOKEN" && echo "GFW_CI_TOKEN not defined" && exit
 BRANCH=$1
 COMMIT=$2
 
+if TAG=$(git describe --exact-match "$COMMIT" 2>/dev/null)
+then
+	echo "Tip of $BRANCH exactly at $TAG"
+	exit 0
+fi
+
 gfwci () {
 	local CURL_ERROR_CODE HTTP_CODE
 	CONTENT_FILE=$(mktemp -t "git-windows-ci-XXXXXX")

^ permalink raw reply related	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2017-07-26 18:08 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-07-12 23:44 Reducing redundant build at Travis? Junio C Hamano
2017-07-13 21:21 ` Lars Schneider
2017-07-13 21:53   ` Junio C Hamano
2017-07-14 12:24     ` Jeff King
2017-07-14 14:54       ` Junio C Hamano
2017-07-14 15:32         ` Jeff King
2017-07-20  8:18           ` Lars Schneider
2017-07-20 15:16             ` Junio C Hamano
2017-07-21 16:11               ` Lars Schneider
2017-07-21 16:44                 ` Junio C Hamano
2017-07-26 16:43                   ` Lars Schneider
2017-07-26 18:08                     ` Junio C Hamano

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).