diff options
Diffstat (limited to 'util/travis_test.sh')
| -rw-r--r-- | util/travis_test.sh | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/util/travis_test.sh b/util/travis_test.sh new file mode 100644 index 000000000..6c48f898c --- /dev/null +++ b/util/travis_test.sh | |||
| @@ -0,0 +1,22 @@ | |||
| 1 | #!/bin/bash | ||
| 2 | |||
| 3 | TRAVIS_COMMIT_MESSAGE="${TRAVIS_COMMIT_MESSAGE:-none}" | ||
| 4 | TRAVIS_COMMIT_RANGE="${TRAVIS_COMMIT_RANGE:-HEAD~1..HEAD}" | ||
| 5 | |||
| 6 | # test force push | ||
| 7 | #TRAVIS_COMMIT_RANGE="c287f1bfc5c8...81f62atc4c1d" | ||
| 8 | |||
| 9 | NUM_IMPACTING_CHANGES=$(git diff --name-only -n 1 ${TRAVIS_COMMIT_RANGE} | grep -Ecv '^(docs/)') | ||
| 10 | BRANCH=$(git rev-parse --abbrev-ref HEAD) | ||
| 11 | |||
| 12 | if [[ "$TRAVIS_COMMIT_MESSAGE" == *"[skip test]"* ]]; then | ||
| 13 | echo "Skipping due to commit message" | ||
| 14 | exit 0 | ||
| 15 | fi | ||
| 16 | |||
| 17 | if [ "$BRANCH" != "master" ] && [ "$NUM_IMPACTING_CHANGES" == "0" ]; then | ||
| 18 | echo "Skipping due to changes not impacting tests" | ||
| 19 | exit 0 | ||
| 20 | fi | ||
| 21 | |||
| 22 | make test:all | ||
