forked from root-project/root
-
Notifications
You must be signed in to change notification settings - Fork 1
/
.travis.yml
62 lines (52 loc) · 1.62 KB
/
.travis.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
sudo: false
language: cpp
addons: &addons
apt:
packages: timeout
sources: &sources
- ubuntu-toolchain-r-test
- llvm-toolchain-precise-3.9
cache:
apt: true
ccache: true
# Do not build our sync branch.
branches:
only:
- master
matrix:
# Abort all builds on a single failing matrix entry.
fast_finish: true
include:
# There seems to be a hard limit to how many machines a Travis build will
# across all platforms. By interleaving OS X, the hope is to get in the
# queue faster while not blocking Linux builds from occuring.
- os: linux
addons:
apt:
sources: *sources
packages: ['clang-format-3.9']
compiler: clang
script:
- |
if [ "$TRAVIS_PULL_REQUEST" != "false" ]; then
BASE_COMMIT=$(git rev-parse $TRAVIS_BRANCH)
echo "Running clang-format-3.9 against branch $TRAVIS_BRANCH, with hash $BASE_COMMIT"
COMMIT_FILES=$(git diff --name-only $BASE_COMMIT | grep -i -v LinkDef)
RESULT_OUTPUT="$(git-clang-format-3.9 --commit $BASE_COMMIT --diff --binary `which clang-format-3.9` $COMMIT_FILES)"
if [ "$RESULT_OUTPUT" == "no modified files to format" ] \
|| [ "$RESULT_OUTPUT" == "clang-format did not modify any files" ] ; then
echo "clang-format passed."
exit 0
else
echo "clang-format failed."
echo "To reproduce it locally please run"
echo -e "\tgit checkout $TRAVIS_BRANCH"
echo -e "\tgit-clang-format --commit $BASE_COMMIT --diff --binary $(which clang-format)"
echo "$RESULT_OUTPUT"
exit 1
fi
fi
on_failure:
-|
echo "Showing current directory contents"
ls -la