Skip to content

Commit

Permalink
Travis: Only trigger a compile, when C/C++ related files were touched (
Browse files Browse the repository at this point in the history
  • Loading branch information
t4im authored and est31 committed Oct 15, 2016
1 parent 9a3129d commit adad6e0
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 0 deletions.
4 changes: 4 additions & 0 deletions util/travis/before_install.sh
@@ -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
Expand Down
8 changes: 8 additions & 0 deletions util/travis/common.sh
@@ -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)"
}
3 changes: 3 additions & 0 deletions util/travis/script.sh
@@ -1,4 +1,7 @@
#!/bin/bash -e
. util/travis/common.sh

needs_compile || exit 0

if [[ $PLATFORM == "Unix" ]]; then
mkdir -p travisbuild
Expand Down

0 comments on commit adad6e0

Please sign in to comment.