Merge branch 'sg/travis-check-untracked'
authorJunio C Hamano <gitster@pobox.com>
Tue, 9 Jan 2018 22:32:55 +0000 (14:32 -0800)
committerJunio C Hamano <gitster@pobox.com>
Tue, 9 Jan 2018 22:32:55 +0000 (14:32 -0800)
* sg/travis-check-untracked:
travis-ci: check that all build artifacts are .gitignore-d
travis-ci: don't store P4 and Git LFS in the working tree

ci/lib-travisci.sh
ci/run-linux32-docker.sh
ci/run-tests.sh
ci/test-documentation.sh
index bade716171c60634e959d32b37a6b51e658b5cf2..07f27c72700702e745eb0a9d1f9b9aa8ec549f4f 100755 (executable)
@@ -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
@@ -99,8 +109,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)
index 870a41246310963383754289d514d15faf8b839f..4f191c5bb12185251f98a2d54422640cb19b8be1 100755 (executable)
@@ -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
index eb5ba4058ad0cf34302d37907ebe98dfbfc06d02..22355f0091a0a3936472179249cf152d9f20fc17 100755 (executable)
@@ -8,4 +8,6 @@
 ln -s $HOME/travis-cache/.prove t/.prove
 make --quiet test
 
+check_unignored_build_artifacts
+
 save_good_tree
index 3d62e6c9539b04f1601b92617a514c1a8b63fe56..a20de9ca127f82ba916534dfb12f3932595dda05 100755 (executable)
@@ -18,6 +18,9 @@ test -s Documentation/git.xml
 test -s Documentation/git.1
 grep '<meta name="generator" content="AsciiDoc ' Documentation/git.html
 
+rm -f stdout.log stderr.log
+check_unignored_build_artifacts
+
 # Build docs with AsciiDoctor
 make clean
 make --jobs=2 USE_ASCIIDOCTOR=1 doc > >(tee stdout.log) 2> >(tee stderr.log >&2)
@@ -26,4 +29,7 @@ sed '/^GIT_VERSION = / d' stderr.log
 test -s Documentation/git.html
 grep '<meta name="generator" content="Asciidoctor ' Documentation/git.html
 
+rm -f stdout.log stderr.log
+check_unignored_build_artifacts
+
 save_good_tree