Travis: Only trigger a compile, when C/C++ related files were touched (#4284)

This commit is contained in:
Tim 2016-10-15 17:59:23 +02:00 committed by est31
parent 9a3129da5e
commit adad6e0a1c
3 changed files with 15 additions and 0 deletions

@ -1,4 +1,8 @@
#!/bin/bash -e
echo "Preparing for $TRAVIS_COMMIT_RANGE"
. util/travis/common.sh
needs_compile || exit 0
if [[ $TRAVIS_OS_NAME == "linux" ]]; then
sudo apt-get update

8
util/travis/common.sh Normal file

@ -0,0 +1,8 @@
#!/bin/bash -e
# Relative to git-repository root:
TRIGGER_COMPILE_PATHS="src/|CMakeLists.txt|cmake/Modules/|util/travis/|util/buildbot/"
needs_compile() {
git diff --name-only $TRAVIS_COMMIT_RANGE | egrep -q "^($TRIGGER_COMPILE_PATHS)"
}

@ -1,4 +1,7 @@
#!/bin/bash -e
. util/travis/common.sh
needs_compile || exit 0
if [[ $PLATFORM == "Unix" ]]; then
mkdir -p travisbuild