-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy path.travis.yml
More file actions
253 lines (212 loc) · 5.63 KB
/
Copy path.travis.yml
File metadata and controls
253 lines (212 loc) · 5.63 KB
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
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
sudo: required
dist: trusty
language: c
matrix:
include:
#
# GCC 7 Build
#
- compiler: gcc-7
os: linux
addons:
apt:
sources:
- ubuntu-toolchain-r-test
packages:
- gcc-7
- g++-7
env:
- TEST="GCC Build"
- COMPILER=gcc-7
script:
- cmake -DCMAKE_C_COMPILER=$COMPILER -DCMAKE_BUILD_TYPE=Release ..
- make -j 4
- ctest -j 4
#
# CLang 4.0 Build
#
- compiler: clang-4.0
os: linux
addons:
apt:
sources:
- ubuntu-toolchain-r-test
- llvm-toolchain-trusty-4.0
packages:
- gcc-7
- g++-7
- clang-4.0
env:
- TEST="CLang Build"
- COMPILER=clang-4.0
script:
- cmake -DCMAKE_C_COMPILER=$COMPILER -DCMAKE_BUILD_TYPE=Release ..
- make -j 4
- ctest -j 4
#
# MUSL Build
#
- compiler: musl-gcc
os: linux
addons:
apt:
sources:
- ubuntu-toolchain-r-test
packages:
- gcc-7
- g++-7
- musl-tools
- musl-dev
env:
- TEST="MUSL Build"
- COMPILER=musl-gcc
script:
- cmake -DCMAKE_C_COMPILER=$COMPILER -DCMAKE_BUILD_TYPE=Release ..
- make -j 4
- ctest -j 4
#
# CppCheck Build
#
- compiler: gcc-7
os: linux
addons:
apt:
sources:
- ubuntu-toolchain-r-test
packages:
- gcc-7
- g++-7
env:
- TEST="CppCheck Build"
- COMPILER=gcc-7
script:
- cmake -DENABLE_CPPCHECK=ON -DCMAKE_C_COMPILER=$COMPILER -DCMAKE_BUILD_TYPE=Release ..
- make -j 4
- make -j 4 check
- ctest -j 4
#
# Git Diff Build
#
- os: linux
env:
- TEST="Git Diff Build"
script:
- |
if [[ -n $(git diff --check HEAD^) ]]; then
echo "You must remove whitespace before submitting a pull request"
echo ""
git diff --check HEAD^
exit -1
fi
#
# Codecov Build
#
- compiler: gcc-7
os: linux
addons:
apt:
sources:
- ubuntu-toolchain-r-test
packages:
- gcc-7
- g++-7
env:
- TEST="Code Coverage Build"
- COMPILER=gcc-7
- CMAKE_C_FLAGS_DEBUG="-std=c11 -Wall -Wextra -Wpedantic -Wchkp -Wuninitialized -Winit-self --coverage -O0"
- CMAKE_EXE_LINKER_FLAGS=-lgcov
- CC_TEST_REPORTER_ID=709c190d97a1ec5988862a2a5b08a8ee3ad5f2798f488915f18c1c9c36fedbf5
before_script:
# Build Folder
- mkdir build
- cd build
# Update / Install CMake
- |
if [[ "${TRAVIS_OS_NAME}" == "linux" ]]; then
mkdir -p external/cmake
pushd external/cmake
wget https://cmake.org/files/v3.9/cmake-3.9.6-Linux-x86_64.sh
chmod +x cmake-*-Linux-x86_64.sh
./cmake-*-Linux-x86_64.sh --exclude-subdir --skip-license
export PATH="${PWD}/bin:$PATH"
popd
else
if ! brew ls --version cmake &>/dev/null; then brew update; brew install cmake; fi
fi
- curl -L https://codeclimate.com/downloads/test-reporter/test-reporter-latest-linux-amd64 > ./cc-test-reporter
- chmod +x ./cc-test-reporter
- ./cc-test-reporter before-build
script:
- cmake -DCMAKE_C_COMPILER=$COMPILER -DCMAKE_BUILD_TYPE=Debug -DCMAKE_C_FLAGS_DEBUG="$CMAKE_C_FLAGS_DEBUG" -DCMAKE_EXE_LINKER_FLAGS=$CMAKE_EXE_LINKER_FLAGS ..
- make -j 4
- ctest -j 4
- cmake --build . --target ContinuousCoverage
after_success:
- bash <(curl -s https://codecov.io/bash) -f '!*unity*' -F unittesting
- ./cc-test-reporter after-build --exit-code $TRAVIS_TEST_RESULT
#
# Valgrind Build
#
- compiler: gcc-7
os: linux
addons:
apt:
sources:
- ubuntu-toolchain-r-test
packages:
- gcc-7
- g++-7
- valgrind
env:
- TEST="Valgrind Build"
- COMPILER=gcc-7
script:
- cmake -DENABLE_MEMCHECK=ON -DCMAKE_C_COMPILER=$COMPILER -DCMAKE_BUILD_TYPE=Release ..
- make -j 4
- ctest -T memcheck
#
# Astyle Build
#
- compiler: gcc-7
os: linux
addons:
apt:
sources:
- ubuntu-toolchain-r-test
packages:
- gcc-7
- g++-7
env:
- TEST="Astyle Build"
- COMPILER=gcc-7
script:
- cmake -DENABLE_ASTYLE=ON -DCMAKE_C_COMPILER=$COMPILER -DCMAKE_BUILD_TYPE=Release ..
- make -j 4
- make format
- |
if [[ -n $(git diff) ]]; then
echo "You must run `make format` before submitting a pull request"
echo ""
git diff
exit -1
fi
before_install:
- sudo apt-get update -qq
- echo "End before install"
before_script:
# Build Folder
- mkdir build
- cd build
# Update / Install CMake
- |
if [[ "${TRAVIS_OS_NAME}" == "linux" ]]; then
mkdir -p external/cmake
pushd external/cmake
wget https://cmake.org/files/v3.9/cmake-3.9.6-Linux-x86_64.sh
chmod +x cmake-*-Linux-x86_64.sh
./cmake-*-Linux-x86_64.sh --exclude-subdir --skip-license
export PATH="${PWD}/bin:$PATH"
popd
else
if ! brew ls --version cmake &>/dev/null; then brew update; brew install cmake; fi
fi