travis-ci: check that all build artifacts are .gitignore-d
[gitweb.git] / ci / lib-travisci.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)