From 88e00b70330449128d3fe1a074d71ccbe236cf4a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?SZEDER=20G=C3=A1bor?= Date: Sun, 31 Dec 2017 17:02:05 +0100 Subject: travis-ci: don't store P4 and Git LFS in the working tree MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The Clang and GCC 64 bit Linux build jobs download and store the P4 and Git LFS executables under the current directory, which is the working tree that we are about to build and test. This means that Git commands like 'status' or 'ls-files' would list these files as untracked. The next commit is about to make sure that there are no untracked files present after the build, and the downloaded executables in the working tree are interfering with those upcoming checks. Therefore, let's download P4 and Git LFS in the home directory, outside of the working tree. Signed-off-by: SZEDER Gábor Signed-off-by: Junio C Hamano --- ci/lib-travisci.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ci/lib-travisci.sh b/ci/lib-travisci.sh index bade71617..1543b7959 100755 --- a/ci/lib-travisci.sh +++ b/ci/lib-travisci.sh @@ -99,8 +99,8 @@ linux-clang|linux-gcc) export LINUX_P4_VERSION="16.2" export LINUX_GIT_LFS_VERSION="1.5.2" - P4_PATH="$(pwd)/custom/p4" - GIT_LFS_PATH="$(pwd)/custom/git-lfs" + P4_PATH="$HOME/custom/p4" + GIT_LFS_PATH="$HOME/custom/git-lfs" export PATH="$GIT_LFS_PATH:$P4_PATH:$PATH" ;; osx-clang|osx-gcc) -- cgit v1.2.1 From b92cb86ea1494c4dfbce28b29f05632ab9f3b179 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?SZEDER=20G=C3=A1bor?= Date: Sun, 31 Dec 2017 17:02:06 +0100 Subject: travis-ci: check that all build artifacts are .gitignore-d MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Every once in a while our explicit .gitignore files get out of sync when our build process learns to create new artifacts, like test helper executables, but the .gitignore files are not updated accordingly. Use Travis CI to help catch such issues earlier: check that there are no untracked files at the end of any build jobs building Git (i.e. the 64 bit Clang and GCC Linux and OSX build jobs, plus the GETTEXT_POISON and 32 bit Linux build jobs) or its documentation, and fail the build job if there are any present. Signed-off-by: SZEDER Gábor Signed-off-by: Junio C Hamano --- ci/lib-travisci.sh | 10 ++++++++++ ci/run-linux32-docker.sh | 2 ++ ci/run-tests.sh | 2 ++ ci/test-documentation.sh | 6 ++++++ 4 files changed, 20 insertions(+) diff --git a/ci/lib-travisci.sh b/ci/lib-travisci.sh index 1543b7959..07f27c727 100755 --- a/ci/lib-travisci.sh +++ b/ci/lib-travisci.sh @@ -67,6 +67,16 @@ skip_good_tree () { exit 0 } +check_unignored_build_artifacts () +{ + ! git ls-files --other --exclude-standard --error-unmatch \ + -- ':/*' 2>/dev/null || + { + echo "$(tput setaf 1)error: found unignored build artifacts$(tput sgr0)" + false + } +} + # Set 'exit on error' for all CI scripts to let the caller know that # something went wrong. # Set tracing executed commands, primarily setting environment variables diff --git a/ci/run-linux32-docker.sh b/ci/run-linux32-docker.sh index 870a41246..4f191c5bb 100755 --- a/ci/run-linux32-docker.sh +++ b/ci/run-linux32-docker.sh @@ -23,4 +23,6 @@ docker run \ daald/ubuntu32:xenial \ /usr/src/git/ci/run-linux32-build.sh $(id -u $USER) +check_unignored_build_artifacts + save_good_tree diff --git a/ci/run-tests.sh b/ci/run-tests.sh index eb5ba4058..22355f009 100755 --- a/ci/run-tests.sh +++ b/ci/run-tests.sh @@ -8,4 +8,6 @@ ln -s $HOME/travis-cache/.prove t/.prove make --quiet test +check_unignored_build_artifacts + save_good_tree diff --git a/ci/test-documentation.sh b/ci/test-documentation.sh index 3d62e6c95..a20de9ca1 100755 --- a/ci/test-documentation.sh +++ b/ci/test-documentation.sh @@ -18,6 +18,9 @@ test -s Documentation/git.xml test -s Documentation/git.1 grep '