Skip to content

Commit

Permalink
travis-ci: check that all build artifacts are .gitignore-d
Browse files Browse the repository at this point in the history
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 <[email protected]>
Signed-off-by: Junio C Hamano <[email protected]>
  • Loading branch information
szeder authored and gitster committed Jan 3, 2018
1 parent 88e00b7 commit b92cb86
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 0 deletions.
10 changes: 10 additions & 0 deletions ci/lib-travisci.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 2 additions & 0 deletions ci/run-linux32-docker.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
2 changes: 2 additions & 0 deletions ci/run-tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,6 @@
ln -s $HOME/travis-cache/.prove t/.prove
make --quiet test

check_unignored_build_artifacts

save_good_tree
6 changes: 6 additions & 0 deletions ci/test-documentation.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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

0 comments on commit b92cb86

Please sign in to comment.