forked from OpenLightingProject/ola
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.travis.yml
372 lines (359 loc) · 12.9 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
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
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
language: cpp
# Default to the fully visualised "sudo" GCE environments, as they are faster for longer running jobs. We don't actually need sudo
sudo: required
# Use the latest Travis images since they are more up to date than the stable release.
group: edge
before_script:
- export -f travis_fold
script:
- "bash -ex .travis-ci.sh"
addons:
apt:
packages: &base_build
# This is the absolute minimum for configure to pass
# Non C++ based tasks use it so they can run make builtfiles
- ccache
- libcppunit-dev
- bison
- flex
- uuid-dev
- libprotobuf-dev
- protobuf-compiler
- libprotoc-dev
packages: &core_build
# This is all the bits we need to enable all options
- *base_build
- libftdi-dev
- libftdi1
- libusb-1.0-0-dev
- liblo-dev
- libavahi-glib1
- libncurses5-dev
- libmicrohttpd-dev
packages: &core_build_gpp_latest
- *core_build
- g++-8
packages: &core_build_clang_latest
- *core_build
- clang-6.0
matrix:
fast_finish: true
include:
- os: osx
osx_image: xcode9.3
compiler: clang
env:
- TASK='compile'
- CPPUNIT='1.13'
- LIBFTDI='0'
- os: osx
osx_image: xcode9.3
compiler: clang
env:
- TASK='compile'
- CPPUNIT='1.14'
- LIBFTDI='0'
- os: osx
osx_image: xcode9.3
compiler: gcc
env:
- TASK='compile'
- CPPUNIT='1.13'
- LIBFTDI='0'
- os: osx
osx_image: xcode9.3
compiler: gcc
env:
- TASK='compile'
- CPPUNIT='1.14'
- LIBFTDI='0'
- os: osx
osx_image: xcode9.3
compiler: clang
env:
- TASK='compile'
- CPPUNIT='1.13'
- PROTOBUF='3.6'
- LIBFTDI='1'
- os: osx
osx_image: xcode9.3
compiler: gcc
env:
- TASK='compile'
- CPPUNIT='1.13'
- PROTOBUF='3.6'
- LIBFTDI='1'
- os: osx
osx_image: xcode9.3
compiler: clang
env:
- TASK='compile'
- CPPUNIT='1.14'
- PROTOBUF='3.6'
- LIBFTDI='1'
- os: osx
osx_image: xcode9.3
compiler: gcc
env:
- TASK='compile'
- CPPUNIT='1.14'
- PROTOBUF='3.6'
- LIBFTDI='1'
- os: linux
dist: xenial
compiler: clang
env: TASK='compile'
python: '2.7'
addons:
apt:
packages:
- *core_build_clang_latest
sources:
- sourceline: "ppa:ubuntu-toolchain-r/test"
- sourceline: "deb http://apt.llvm.org/xenial/ llvm-toolchain-xenial-6.0 main"
key_url: "https://apt.llvm.org/llvm-snapshot.gpg.key"
- os: linux
dist: xenial
compiler: gcc
env: TASK='compile'
python: '2.7'
addons:
apt:
packages:
- *core_build_gpp_latest
sources:
- sourceline: "ppa:ubuntu-toolchain-r/test"
- os: linux
dist: xenial
compiler: gcc
env: TASK='coverage'
addons:
apt:
packages:
- *core_build_gpp_latest
sources:
- sourceline: "ppa:ubuntu-toolchain-r/test"
- os: linux
dist: xenial
compiler: gcc
env: TASK='coverity'
addons:
apt:
packages:
# Coverity doesn't work with g++-5 or g++-6 yet
- *core_build
- g++-4.9
sources:
- sourceline: "ppa:ubuntu-toolchain-r/test"
- os: linux
dist: xenial
env: TASK='doxygen'
addons:
apt:
packages:
- *core_build_gpp_latest
- doxygen
- graphviz
sources:
- sourceline: "ppa:ubuntu-toolchain-r/test"
- os: linux
dist: xenial
env: TASK='lint'
addons:
apt:
packages:
- *core_build
- os: linux
dist: xenial
env: TASK='check-licences'
addons:
apt:
packages:
- *core_build
- os: linux
dist: xenial
env: TASK='spellintian'
addons:
apt:
packages:
- *core_build
- moreutils
- os: linux
dist: xenial
env: TASK='spellintian-duplicates'
addons:
apt:
packages:
- *core_build
- moreutils
- os: linux
dist: xenial
env: TASK='codespell'
addons:
apt:
packages:
- *core_build
- moreutils
- os: linux
dist: xenial
env: TASK='jshint'
addons:
apt:
packages:
- os: linux
dist: xenial
env: TASK='flake8'
addons:
apt:
packages:
- *base_build
- os: linux
dist: xenial
env: TASK='pychecker'
python: '2.7'
addons:
apt:
packages:
- *base_build
- os: linux
dist: xenial
env: TASK='pychecker-wip'
python: '2.7'
addons:
apt:
packages:
- *base_build
allow_failures:
- os: osx
osx_image: xcode9.3
compiler: clang
env:
- TASK='compile'
- CPPUNIT='1.13'
- LIBFTDI='0'
- os: osx
osx_image: xcode9.3
compiler: clang
env:
- TASK='compile'
- CPPUNIT='1.14'
- LIBFTDI='0'
- os: osx
osx_image: xcode9.3
compiler: gcc
env:
- TASK='compile'
- CPPUNIT='1.13'
- LIBFTDI='0'
- os: osx
osx_image: xcode9.3
compiler: gcc
env:
- TASK='compile'
- CPPUNIT='1.14'
- LIBFTDI='0'
- os: linux
dist: xenial
compiler: gcc
env: TASK='coverage'
- os: linux
dist: xenial
compiler: gcc
env: TASK='coverity'
- os: linux
dist: xenial
env: TASK='pychecker-wip'
- os: linux
dist: xenial
env: TASK='spellintian'
- os: linux
dist: xenial
env: TASK='spellintian-duplicates'
env:
global:
# No colours in terminal (to reduce log file size)
- TERM=dumb
# Parallel make build
- MAKEFLAGS="-j 2"
# -- BEGIN Coverity Scan ENV
- COVERITY_SCAN_BUILD_COMMAND_PREPEND="cov-configure --comptype gcc --compiler gcc-4.9 --template && autoreconf -i && ./configure --enable-ja-rule --enable-e133"
# The build command with all of the arguments that you would apply to a manual `cov-build`
# Usually this is the same as STANDARD_BUILD_COMMAND, excluding the automated test arguments
- COVERITY_SCAN_BUILD_COMMAND="make"
# Name of the project
- COVERITY_SCAN_PROJECT_NAME="$TRAVIS_REPO_SLUG"
# Email address for notifications related to this build
- COVERITY_SCAN_NOTIFICATION_EMAIL="ola-coverity@pjnewman.co.uk"
# Regular expression selects on which branches to run analysis
# Be aware of quotas. Do not run on every branch/commit
- COVERITY_SCAN_BRANCH_PATTERN=".*"
# COVERITY_SCAN_TOKEN via "travis encrypt" using the repo's public key
- secure: "U+NmPtScHZ1NLmkDrzpqApHmJvELV44cXgjQsxA8N8xIATckbs+DrmWSNeECENyvuOPz+nPzglSgBvJtejf97jYJIIwAExq5TJMUAIPFS6KU3mohODW2PZSoVoUyJPzFIlhzcELQgONI+ILLm29lNdQNb7GFUVtO6+jS10AFtWY="
# -- END Coverity Scan ENV
cache:
apt: true
directories:
- $HOME/.cache/pip # pip cache
- $HOME/.npm # npm cache
- $HOME/.ccache # ccache cache
- $HOME/.m2 # maven cache
before_cache:
- rm -f $HOME/.cache/pip/log/debug.log # erase log
- ccache -s # see how many hits ccache got
install:
# Match the version of protobuf being installed via apt
- if [[ "$PROTOBUF" == "3.6" ]]; then pip install --user protobuf==3.6.0; fi
- if [[ "$PROTOBUF" != "3.6" ]]; then pip install --user protobuf==3.1.0; fi
# We need to use pip rather than apt on Xenial
- if [ "$TRAVIS_OS_NAME" == "linux" ]; then pip install --user numpy; fi
- if [ "$TASK" = "coverage" ]; then pip install --user cpp-coveralls; fi
- if [ "$TASK" = "flake8" ]; then pip install --user flake8; fi
- if [ "$TASK" = "codespell" ]; then pip install --user git+https://github.com/codespell-project/codespell.git; fi
- if [ "$TASK" = "jshint" ]; then npm install -g grunt-cli; fi
# If this causes SSL errors, then Sourceforge is probably in disaster recovery mode and needing Javascript. Could switch to a specific mirror, e.g. kent.dl.sourceforge.net
- if [ "$TASK" = "pychecker" -o "$TASK" = "pychecker-wip" ]; then pip install --user http://sourceforge.net/projects/pychecker/files/pychecker/0.8.19/pychecker-0.8.19.tar.gz/download; fi
# This is a very bodgy workaround to the fact that the pip install of the archive doesn't seem to work properly now on Travis
- if [ "$TASK" = "pychecker" -o "$TASK" = "pychecker-wip" ]; then sudo mkdir -p /pychecker/; sudo ln -s /home/travis/.local/lib/python2.7/site-packages/pychecker/checker.py /pychecker/checker.py; fi
before_install:
- if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then brew update; fi
#Fix a broken homebrew libtool install
- if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then brew reinstall libtool; fi
#Fix a broken homebrew python upgrade - see https://github.com/Homebrew/homebrew-core/issues/26358
- if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then brew upgrade python || true; fi
- if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then if [ ! -d /usr/local/sbin ]; then sudo mkdir -p /usr/local/sbin && sudo chown -R $(whoami) /usr/local/sbin; fi; fi
- if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then brew install ccache bison flex liblo libmicrohttpd; fi # ossp-uuid, homebrew/python/numpy and libusb already present
- if [ "$TRAVIS_OS_NAME" == "osx" -a "$LIBFTDI" != "1" ]; then brew install libftdi0; fi # install libftdi0
- if [ "$TRAVIS_OS_NAME" == "osx" -a "$LIBFTDI" == "1" ]; then brew install libftdi; fi # install the latest libftdi
- if [ "$TRAVIS_OS_NAME" == "osx" -a "$PROTOBUF" == "3.6" ]; then brew install protobuf@3.6; fi
- if [ "$TRAVIS_OS_NAME" == "osx" -a "$PROTOBUF" == "3.6" ]; then brew link -f protobuf@3.6; export PKG_CONFIG_PATH=/usr/local/opt/protobuf@3.6/lib/pkgconfig; fi # When protobuf is not on the latest release
- if [ "$TRAVIS_OS_NAME" == "osx" -a "$PROTOBUF" != "3.6" ]; then brew install protobuf@3.1; fi
- if [ "$TRAVIS_OS_NAME" == "osx" -a "$PROTOBUF" != "3.6" ]; then brew link -f protobuf@3.1; export PKG_CONFIG_PATH=/usr/local/opt/protobuf@3.1/lib/pkgconfig; brew install --build-from-source --ignore-dependencies --env=std protobuf-c; fi # When protobuf is not on the latest release
- if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then mkdir -p ${HOME}/Library/Python/2.7/lib/python/site-packages; echo 'import site; site.addsitedir("/usr/local/lib/python2.7/site-packages")' >> ${HOME}/Library/Python/2.7/lib/python/site-packages/homebrew.pth; fi
- if [ "$TRAVIS_OS_NAME" == "osx" -a "$CPPUNIT" != "1.14" ]; then brew install https://raw.githubusercontent.com/Homebrew/homebrew-core/e6e43cf6a3%5E/Formula/cppunit.rb; fi # install a slightly older cppunit, as latest needs C++11 support
- if [ "$TRAVIS_OS_NAME" == "osx" -a "$CPPUNIT" == "1.14" ]; then brew install cppunit; fi # install the latest cppunit, which needs C++11
- if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then PATH=/usr/local/opt/ccache/libexec:$PATH; fi # Use ccache on Mac too
#Coverity doesn't work with g++ 5 or 6, so only upgrade to g++ 4.9 for that
- if [ "$TRAVIS_OS_NAME" == "linux" -a \( "$TASK" = "compile" -o "$TASK" = "coverage" -o "$TASK" = "doxygen" \) -a "$CXX" = "g++" ]; then export CXX="ccache g++-8" CC="ccache gcc-8"; fi
- if [ "$TASK" = "coverity" -a "$CXX" = "g++" ]; then export CXX="g++-4.9" CC="gcc-4.9"; fi
#Use the latest clang if we're compiling with clang
- if [ "$TRAVIS_OS_NAME" == "linux" -a "$CXX" = "clang++" ]; then export CXX="clang++-6.0" CC="clang-6.0"; fi
#Report the compiler version
- $CXX --version
- if [ "$TASK" == "spellintian" -o "$TASK" == "spellintian-duplicates" ]; then wget "http://archive.ubuntu.com/ubuntu/pool/main/l/lintian/lintian_2.5.104_all.deb"; sudo dpkg -i lintian_*.deb; sudo apt-get install -f -y; fi # Install a later lintian
after_failure:
# Disabled as otherwise the logfile is too big
# - if [ -f ${TRAVIS_BUILD_DIR}/config.log ]; then cat ${TRAVIS_BUILD_DIR}/config.log; fi
- if [ -f ${TRAVIS_BUILD_DIR}/ola-*/_build/config.log ]; then cat ${TRAVIS_BUILD_DIR}/ola-*/_build/config.log; fi
- if [ -f ${TRAVIS_BUILD_DIR}/ola-*/_build/sub/config.log ]; then cat ${TRAVIS_BUILD_DIR}/ola-*/_build/sub/config.log; fi
- if [ -f ${TRAVIS_BUILD_DIR}/ola-*/_build/test-suite.log ]; then cat ${TRAVIS_BUILD_DIR}/ola-*/_build/test-suite.log; fi
- if [ -f ${TRAVIS_BUILD_DIR}/ola-*/_build/sub/test-suite.log ]; then cat ${TRAVIS_BUILD_DIR}/ola-*/_build/sub/test-suite.log; fi
after_success:
- if [ "$TASK" = "coverage" ]; then coveralls --gcov /usr/bin/gcov-8 -b . -E '.*Test\.cpp$' -E '.*\.pb\.cc$' -E '.*\.pb\.cpp$' -E '.*\.pb\.h$' -E '.*\.yy\.cpp$' -E '.*\.tab\.cpp$' -E '.*\.tab\.h$' -E '.*/doxygen/examples.*$' --gcov-options '\-lp' > /dev/null; fi
after_script:
- if [ "$TASK" = "coverity" ]; then tail -n 10000 ${TRAVIS_BUILD_DIR}/cov-int/build-log.txt; cat ${TRAVIS_BUILD_DIR}/cov-int/scm_log.txt; fi
notifications:
irc:
channels:
- "chat.freenode.net#openlighting"
on_success: change
on_failure: change