This repository has been archived by the owner on May 24, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy path.travis.yml
217 lines (205 loc) · 5.4 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
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
sudo: required
dist: xenial
language: cpp
# Install Bazel and cppcheck.
install:
- sudo apt-get update
- sudo apt-get install pkg-config zip g++ zlib1g-dev unzip python
- sudo add-apt-repository -y ppa:webupd8team/java
- sudo apt-get update && sudo apt-get install openjdk-8-jdk
- sudo echo "deb [arch=amd64] http://storage.googleapis.com/bazel-apt stable jdk1.8" | sudo tee /etc/apt/sources.list.d/bazel.list
- curl https://storage.googleapis.com/bazel-apt/doc/apt-key.pub.gpg | sudo apt-key add -
- sudo apt-get update && sudo apt-get install bazel
- sudo apt-get install cppcheck
matrix:
include:
# Format
- os: linux
env:
- "TEST=Format"
addons:
apt:
sources:
- llvm-toolchain-xenial-4.0
packages:
- clang-format-4.0
script:
- clang-format -i tally/include/tally/*.h tally/src/*.{h,cc} tally/tests/*.{h,cc} m3/include/m3/*.h m3/src/*.{h,cc} m3/tests/*.{h,cc}
- |
if [[ -n $(git diff) ]]; then
echo "Source code is not formatted properly"
echo ""
git diff
exit -1
fi
# CppCheck
- os: linux
env:
- TEST="CppCheck"
addons:
apt:
sources:
- ubuntu-toolchain-r-test
packages:
- gcc-6
- g++-6
script:
- cppcheck --version
- cppcheck --inline-suppr --enable=all --error-exitcode=1 -I m3/include/ -I tally/include/ --suppress='*:m3/include/m3/thrift/*' m3/ tally/
# TODO(jeromefroe): clang-tidy is unable to find the header files it needs when it runs
# so we need to find out why the generate script we use to create the compile command
# database isn't identifying them properly.
# # Clang Tidy
# - os: linux
# env:
# - TEST="ClangTidy"
# addons:
# apt:
# sources:
# - llvm-toolchain-xenial-4.0
# packages:
# - clang-4.0
# - clang-tidy-4.0
# script:
# - export CXX="clang++"
# - export CC="clang"
# - bazel build //...
# - external/compilation-database/generate.sh
# - clang-tidy tally/src/*.cc m3/src/*.cc > output.txt
# - |
# if [[ -n $(grep "warning: " output.txt) ]] || [[ -n $(grep "error: " output.txt) ]]; then
# echo "You must pass the clang tidy checks before submitting a pull request"
# echo ""
# grep --color -E '^|warning: |error: ' output.txt
# exit -1;
# else
# echo -e "\033[1;32m\xE2\x9C\x93 passed:\033[0m $1";
# fi
# Address Sanitizer
- os: linux
env:
- TEST="Address Sanitizer"
script:
- export CXX="clang++"
- export CC="clang"
- clang --version
- bazel version
- bazel build //... --config asan
- bazel test --test_output=all --test_timeout=60 //... --config asan
# Thread Sanitizer
- os: linux
env:
- TEST="Thread Sanitizer"
script:
- export CXX="clang++"
- export CC="clang"
- clang --version
- bazel version
- bazel build //... --config tsan
- bazel test --test_output=all --test_timeout=60 //... --config tsan
# G++ 5
- os: linux
env:
- TEST="G++ 5"
addons:
apt:
sources:
- ubuntu-toolchain-r-test
packages:
- gcc-5
- g++-5
script:
- export CXX="g++-5"
- export CC="gcc-5"
- gcc --version
- bazel version
- bazel build //...
- bazel test --test_output=all --test_timeout=60 //...
# G++ 6
- os: linux
env:
- TEST="G++ 6"
addons:
apt:
sources:
- ubuntu-toolchain-r-test
packages:
- gcc-6
- g++-6
script:
- export CXX="g++-6"
- export CC="gcc-6"
- gcc --version
- bazel version
- bazel build //...
- bazel test --test_output=all --test_timeout=60 //...
# G++ 7
- os: linux
env:
- TEST="G++ 7"
addons:
apt:
sources:
- ubuntu-toolchain-r-test
packages:
- gcc-7
- g++-7
script:
- export CXX="g++-7"
- export CC="gcc-7"
- gcc --version
- bazel version
- bazel build //...
- bazel test --test_output=all --test_timeout=60 //...
# Clang 4.0
- os: linux
env:
- TEST="Clang 4.0"
addons:
apt:
sources:
- llvm-toolchain-xenial-4.0
packages:
- clang-4.0
script:
- export CXX="clang++-4.0"
- export CC="clang-4.0"
- clang --version
- bazel version
- bazel build //...
- bazel test --test_output=all --test_timeout=60 //...
# Clang 5.0
- os: linux
env:
- TEST="Clang 5.0"
addons:
apt:
sources:
- llvm-toolchain-xenial-5.0
packages:
- clang-5.0
script:
- export CXX="clang++-5.0"
- export CC="clang-5.0"
- clang --version
- bazel version
- bazel build //...
- bazel test --test_output=all --test_timeout=60 //...
# Clang 6.0
- os: linux
env:
- TEST="Clang 6.0"
addons:
apt:
sources:
- ubuntu-toolchain-r-test
- llvm-toolchain-xenial-6.0
packages:
- clang-6.0
script:
- export CXX="clang++-6.0"
- export CC="clang-6.0"
- clang --version
- bazel version
- bazel build //...
- bazel test --test_output=all --test_timeout=60 //...