forked from robotology/yarp
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.travis.yml
400 lines (331 loc) · 14.2 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
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
sudo: required
dist: trusty
language: cpp
cache:
ccache: true
directories:
- $HOME/Library/Caches/Homebrew
os:
- linux
- osx
compiler:
- gcc
- clang
branches:
except:
- /^.*appveyor.*$/
env:
global:
- TRAVIS_CMAKE_GENERATOR="Unix Makefiles"
- TRAVIS_BUILD_TYPE=Release
- TRAVIS_WITH_INTEGRATION_TESTS=false
- TRAVIS_WITH_ACE=true
- TRAVIS_WITH_MATH=true
- TRAVIS_STATIC=false
- TRAVIS_CLEAN_API=false
- TRAVIS_WITH_VALGRIND=false
- TRAVIS_NO_DEPRECATED=false
- TRAVIS_WITH_BROKEN_TESTS=false
# ROS-related env variables. Used only by integration tests
- ROS_HOSTNAME=localhost
- ROS_MASTER_URI=http://localhost:11311
- ROBOT=sim
# Force ccache to build the original cpp file instead of the pre-processed file
- CCACHE_CPP2=yes
addons:
apt:
update: true
sources:
- ubuntu-toolchain-r-test
- llvm-toolchain-trusty-5.0
packages:
# gcc
- gcc-7
- g++-7
# clang
- clang-5.0
# build tools
- ninja-build
- lcov
- valgrind
- ccache
# libraries
- libace-dev
- libsqlite3-dev
- libtinyxml-dev
- libedit-dev
- qtbase5-dev
- qtdeclarative5-dev
- qtmultimedia5-dev
- libqt5opengl5-dev
- libqcustomplot-dev
- libopencv-dev
- libeigen3-dev
- libgraphviz-dev
- libgstreamer1.0-dev
- libgstreamer-plugins-base1.0-dev
# Bindings
- swig3.0
# C# bindings
- mono-mcs
# Lua bindings
- liblua5.1-0-dev
- lua5.1
# TCL/TK bindings
- tcl-dev
- tk-dev
# Python bindings
- python3-dev
# Octave bindings
- liboctave-dev
# Java bindings
- default-jdk
# Ruby bindings
- ruby-dev
matrix:
exclude:
- os: osx
include:
# No ACE build (linux, gcc)
- os: linux
compiler: gcc
env: TRAVIS_WITH_ACE=false
# No ACE build (linux, clang)
- os: linux
compiler: clang
env: TRAVIS_WITH_ACE=false
# No YARP_math build (linux, gcc)
- os: linux
compiler: gcc
env: TRAVIS_WITH_MATH=false
# No YARP_math build (linux, clang)
- os: linux
compiler: clang
env: TRAVIS_WITH_MATH=false
# Normal build with CLEAN_API (linux, gcc)
- os: linux
compiler: gcc
env: TRAVIS_CLEAN_API=true
# Normal build with CLEAN_API (linux, clang)
- os: linux
compiler: clang
env: TRAVIS_CLEAN_API=true
# Normal build with Ninja generator (linux, gcc)
- os: linux
compiler: gcc
env: TRAVIS_CMAKE_GENERATOR="Ninja"
# Normal build with Ninja generator (linux, clang)
- os: linux
compiler: clang
env: TRAVIS_CMAKE_GENERATOR="Ninja"
# Normal build no deprecated (linux, gcc)
- os: linux
compiler: gcc
env: TRAVIS_NO_DEPRECATED=true
# Normal build no deprecated (linux, clang)
- os: linux
compiler: clang
env: TRAVIS_NO_DEPRECATED=true
# Static build (linux, gcc)
- os: linux
compiler: gcc
env: TRAVIS_STATIC=true
# Static build (linux, clang)
- os: linux
compiler: clang
env: TRAVIS_STATIC=true
# Static build, no ACE (linux, gcc)
- os: linux
compiler: gcc
env: TRAVIS_WITH_ACE=false TRAVIS_STATIC=true
# Static build, no ACE (linux, clang)
- os: linux
compiler: clang
env: TRAVIS_WITH_ACE=false TRAVIS_STATIC=true
# Normal build with valgrind (linux, gcc)
- os: linux
compiler: gcc
env: TRAVIS_WITH_VALGRIND=true
# No ACE build with valgrind (linux, gcc)
- os: linux
compiler: gcc
env: TRAVIS_WITH_ACE=false TRAVIS_WITH_VALGRIND=true
# Normal build with valgrind and broken tests (linux, gcc)
# - os: linux
# compiler: gcc
# env: TRAVIS_WITH_VALGRIND=true TRAVIS_WITH_BROKEN_TESTS=true
# Normal build with clang (osx, clang)
- os: osx
osx_image: xcode8.3
compiler: clang
# Normal build with Xcode 8.3 (osx, clang)
- os: osx
osx_image: xcode8.3
compiler: clang
env: TRAVIS_CMAKE_GENERATOR="Xcode"
# Normal build with Xcode 9.1 (osx, clang)
- os: osx
osx_image: xcode9.1
compiler: clang
env: TRAVIS_CMAKE_GENERATOR="Xcode"
# Normal build with Coverage (linux, gcc)
# - os: linux
# compiler: gcc
# env: TRAVIS_BUILD_TYPE=Profile
# Normal build with integration tests (linux, gcc)
# - os: linux
# compiler: gcc
# env: TRAVIS_WITH_INTEGRATION_TESTS=true
# addons:
# apt:
# sources:
# - sourceline: 'deb http://packages.ros.org/ros/ubuntu trusty main'
# key_url: 'http://packages.ros.org/ros.key'
# packages:
# - ros-jade-desktop-full
# Normal build with integration tests (linux, clang)
# - os: linux
# compiler: clang
# env: TRAVIS_WITH_INTEGRATION_TESTS=true
# addons:
# apt:
# sources:
# - sourceline: 'deb http://packages.ros.org/ros/ubuntu trusty main'
# key_url: 'http://packages.ros.org/ros.key'
# packages:
# - ros-jade-desktop-full
# allow_failures:
# # Broken tests are supposed to fail
# - env: TRAVIS_WITH_VALGRIND=true TRAVIS_WITH_BROKEN_TESTS=true
notifications:
irc:
channels:
- "chat.freenode.net#yarpers"
template:
- "%{repository}/%{branch} (%{commit} - %{author}): %{build_url}: %{message}"
use_notice: true
skip_join: true
slack:
secure: PFCRF5GqjLKAghKHz+Dl2yOlRM5Ud8uI8s4AvshsHVmW4VNDhJfLzi3cGqWGjptZ2CBSMSrd5noANQCfeKObqwpeW3na8vrEO/l0RrgqV0idpiDOMotSRbCTB6I7DNKL31ZsQ4qm7eOroWlauNSiC+CBLmwShE9+N2zWC25JXSo=
before_install:
# Update repositories (macOS)
- if [ "$TRAVIS_OS_NAME" == "osx" ]; then brew update; fi
# Install ccache on osx
- if [ "$TRAVIS_OS_NAME" == "osx" ]; then brew install ccache; fi
- if [ "$TRAVIS_OS_NAME" == "osx" ]; then export PATH="/usr/local/opt/ccache/libexec:$PATH"; fi
# Use ccache also for clang and clang++ on linux
- if [ "$TRAVIS_OS_NAME" == "linux" ]; then sudo ln -s ../../bin/ccache /usr/lib/ccache/clang; fi
- if [ "$TRAVIS_OS_NAME" == "linux" ]; then sudo ln -s ../../bin/ccache /usr/lib/ccache/clang++; fi
- if [ "$TRAVIS_OS_NAME" == "linux" ]; then sudo ln -s ../../bin/ccache /usr/lib/ccache/clang-5.0; fi
- if [ "$TRAVIS_OS_NAME" == "linux" ]; then sudo ln -s ../../bin/ccache /usr/lib/ccache/clang++-5.0; fi
# These can be removed for ccache 3.2 (at the moment Ubunty trusty has 3.1.9)
# see https://bugzilla.samba.org/show_bug.cgi?id=8118
- if [ "$TRAVIS_OS_NAME" == "linux" ]; then if [ "$CC" == "clang" ]; then export CFLAGS="$CFLAGS -Qunused-arguments"; fi; fi
- if [ "$TRAVIS_OS_NAME" == "linux" ]; then if [ "$CXX" == "clang++" ]; then export CXXFLAGS="$CXXFLAGS -Qunused-arguments"; fi; fi
# Force gcc-7
- if [ "$TRAVIS_OS_NAME" == "linux" ]; then if [ "$CC" == "gcc" ]; then export CC=gcc-7; export CXX=g++-7; fi; fi
# Force clang-5.0
- if [ "$TRAVIS_OS_NAME" == "linux" ]; then if [ "$CC" == "clang" ]; then export CC=clang-5.0; export CXX=clang++-5.0; fi; fi
# Remove default clang from path
- if [ "$TRAVIS_OS_NAME" == "linux" ]; then export PATH=`echo $PATH | sed -e 's/\/usr\/local\/clang-3.5.0\/bin://'`; fi
# Print some more system information after installing all build tools
- echo "-------------------- BEGIN SYSTEM INFORMATION --------------------"
- uname -a
- if [ "$TRAVIS_OS_NAME" == "linux" ]; then lsb_release -a; fi
- if [ "$TRAVIS_OS_NAME" == "osx" ]; then system_profiler SPSoftwareDataType; fi
- env
- if [ "$TRAVIS_OS_NAME" == "linux" ]; then cat /etc/apt/sources.list; fi
- if [ "$TRAVIS_OS_NAME" == "linux" ]; then ls /etc/apt/sources.list.d; fi
- which cmake
- cmake --version
- which $CC
- $CC --version
- which $CXX
- $CXX --version
- which ccache
- ccache --version
- ccache -s
- if [ "$TRAVIS_OS_NAME" == "linux" ]; then ls -la /usr/lib/ccache; fi
- if [ "$TRAVIS_OS_NAME" == "linux" ]; then which swig3.0; fi
- if [ "$TRAVIS_OS_NAME" == "linux" ]; then swig3.0 -version; fi
- which javac
- javac -version
- echo "-------------------- END SYSTEM INFORMATION --------------------"
install:
# Install ACE
- if [ "$TRAVIS_OS_NAME" == "osx" ]; then if $TRAVIS_WITH_ACE; then brew install ace; fi; fi
# Install other core dependencies (sqlite, tinyxml, libedit)
- if [ "$TRAVIS_OS_NAME" == "osx" ]; then brew install sqlite tinyxml libedit; fi
# Install Qt5 GUIs dependencies
- if [ "$TRAVIS_OS_NAME" == "osx" ]; then brew install qt5; fi
- if [ "$TRAVIS_OS_NAME" == "osx" ]; then export Qt5_DIR="/usr/local/opt/qt5/lib/cmake/Qt5"; fi
# Fix issue in trusty version of Qt5
- if [ "$TRAVIS_OS_NAME" == "linux" ]; then sudo sed -i 's/COPY_ONLY/COPYONLY/g' /usr/lib/x86_64-linux-gnu/cmake/Qt5Core/Qt5CoreMacros.cmake; fi
# Install other dependencies (opencv, eigen, graphviz)
- if [ "$TRAVIS_OS_NAME" == "osx" ]; then /usr/bin/yes | pip2 uninstall numpy || true; fi
- if [ "$TRAVIS_OS_NAME" == "osx" ]; then brew install opencv eigen graphviz; fi
# Install swig stuff
- if $TRAVIS_WITH_INTEGRATION_TESTS; then wget https://github.com/robotology-dependencies/swigs/releases/download/v0.0.5/swigs.zip; fi
- if $TRAVIS_WITH_INTEGRATION_TESTS; then unzip -q swigs.zip; mkdir -p cache; mv swigs cache/swig; fi
# Init ROS
- if $TRAVIS_WITH_INTEGRATION_TESTS; then source /opt/ros/jade/setup.bash; fi
before_script:
# Prepare build directory
- mkdir -p build
- if $TRAVIS_WITH_INTEGRATION_TESTS; then ln -s ../cache build/cache; fi
# Prepare cmake options
- . scripts/admin/generate-cmake-options.sh $(hostname) $(lsb_release -cs) continuous
- export YARP_INSTALL_PREFIX="${PWD}/install"
- export YARP_CMAKE_OPTIONS="${CMAKE_OPTIONS} -DCMAKE_INSTALL_PREFIX=${YARP_INSTALL_PREFIX} -DYARP_EXPERIMENTAL_CXX11=ON"
- if ! $TRAVIS_WITH_ACE; then export YARP_CMAKE_OPTIONS="${YARP_CMAKE_OPTIONS} -DSKIP_ACE=ON -DYARP_TEST_HEAP=ON"; fi
- if ! $TRAVIS_WITH_MATH; then export YARP_CMAKE_OPTIONS="${YARP_CMAKE_OPTIONS} -DCREATE_LIB_MATH:BOOL=OFF -DENABLE_yarpmod_fakeIMU:BOOL=OFF -DENABLE_yarpmod_fakeLaser:BOOL=OFF"; fi
- if [ "$TRAVIS_OS_NAME" == "linux" ]; then export YARP_CMAKE_OPTIONS="${YARP_CMAKE_OPTIONS} -DENABLE_yarpcar_h264:BOOL=ON"; fi
- if [ "$TRAVIS_OS_NAME" == "linux" ]; then export YARP_CMAKE_OPTIONS="${YARP_CMAKE_OPTIONS} -DYARP_COMPILE_BINDINGS=ON -DCREATE_LUA=ON -DCREATE_PYTHON=ON -DCREATE_TCL=ON -DCREATE_JAVA=ON -DCREATE_CSHARP=ON"; fi
- if $TRAVIS_STATIC; then export YARP_CMAKE_OPTIONS="${YARP_CMAKE_OPTIONS} -DCREATE_SHARED_LIBRARY=OFF"; fi
- if $TRAVIS_CLEAN_API; then export YARP_CMAKE_OPTIONS="${YARP_CMAKE_OPTIONS} -DYARP_CLEAN_API=ON -DYARP_COMPILE_TESTS=OFF"; fi
- if $TRAVIS_WITH_VALGRIND; then export YARP_CMAKE_OPTIONS="${YARP_CMAKE_OPTIONS} -DYARP_VALGRIND_TESTS=ON -DYARP_VALGRIND_DRD_TESTS=OFF -DYARP_VALGRIND_HELGRIND_TESTS=OFF YARP_VALGRIND_MEMCHECK_TESTS=ON YARP_VALGRIND_SGCHECK_TESTS=OFF"; fi
- if $TRAVIS_NO_DEPRECATED; then export YARP_CMAKE_OPTIONS="${YARP_CMAKE_OPTIONS} -DYARP_NO_DEPRECATED=ON"; fi
- if $TRAVIS_WITH_BROKEN_TESTS; then export YARP_CMAKE_OPTIONS="${YARP_CMAKE_OPTIONS} -DYARP_ENABLE_BROKEN_TESTS=ON"; fi
- if $TRAVIS_WITH_INTEGRATION_TESTS; then export YARP_CMAKE_OPTIONS="${YARP_CMAKE_OPTIONS} -DYARP_TEST_INTEGRATION=ON"; fi
# TinyXML on trusty is built with C++98 ABI and clang fails.
- if [ "$TRAVIS_OS_NAME" == "linux" ]; then if [ "$CC" == "clang" ]; then export YARP_CMAKE_OPTIONS="${YARP_CMAKE_OPTIONS} -DYARP_USE_SYSTEM_TINYXML=OFF"; fi; fi
# OpenCV on travis is built with C++98 ABI.
- if [ "$TRAVIS_OS_NAME" == "linux" ]; then if [ "$CC" == "clang" ]; then export YARP_CMAKE_OPTIONS="${YARP_CMAKE_OPTIONS} -DYARP_USE_OPENCV=OFF"; fi; fi
# Avoid building Qt5 guis twice on macOS.
- if [ "$TRAVIS_OS_NAME" == "osx" ]; then YARP_CMAKE_OPTIONS="${YARP_CMAKE_OPTIONS} -DYARP_DISABLE_OSX_BUNDLES=ON"; fi
# Disable tests with race conditions on macOS.
- if [ "$TRAVIS_OS_NAME" == "osx" ]; then YARP_CMAKE_OPTIONS="${YARP_CMAKE_OPTIONS} -DYARP_DISABLE_FAILING_TESTS=ON"; fi
# Print cmake flags
- echo "-------------------- BEGIN CMAKE FLAGS --------------------"
- echo -G"${TRAVIS_CMAKE_GENERATOR}" -DCMAKE_BUILD_TYPE=${TRAVIS_BUILD_TYPE} ${YARP_CMAKE_OPTIONS}
- echo "-------------------- END CMAKE FLAGS --------------------"
# Run CMake
- (cd build; cmake -G"${TRAVIS_CMAKE_GENERATOR}" -DCMAKE_BUILD_TYPE=${TRAVIS_BUILD_TYPE} ${YARP_CMAKE_OPTIONS} ..)
# Print cmake cache
- echo "-------------------- BEGIN CMAKE CACHE --------------------"
- (cd build; cat CMakeCache.txt)
- echo "-------------------- END CMAKE CACHE --------------------"
# Reset coverage information
- if [ "$TRAVIS_BUILD_TYPE" == "Profile" ]; then (cd build; lcov --directory . --zerocounters); fi
script:
# Build yarp
- (cd build; cmake --build . --config ${TRAVIS_BUILD_TYPE})
# Configure yarp
- if $TRAVIS_WITH_INTEGRATION_TESTS; then build/bin/yarp conf 0 0 local; fi
# Run unit tests
- if ! $TRAVIS_CLEAN_API; then (cd build; travis_wait 50 ctest --output-on-failure --build . -C ${TRAVIS_BUILD_TYPE}); fi
# Test installation
- (cd build; cmake --build . --config ${TRAVIS_BUILD_TYPE} --target install)
# Build also the os examples
- mkdir example/os/build
- (cd example/os/build; cmake -G"${TRAVIS_CMAKE_GENERATOR}" -DCMAKE_BUILD_TYPE=${TRAVIS_BUILD_TYPE} -DYARP_DIR=${YARP_INSTALL_PREFIX}/lib/cmake/YARP ..)
- (cd example/os/build; cmake --build . --config ${TRAVIS_BUILD_TYPE})
after_success:
# Capture coverage info for Profile builds
- if [ "$TRAVIS_BUILD_TYPE" == "Profile" ]; then (cd build; lcov --directory . --capture --output-file coverage.info); fi
# Filter out system and test code
- if [ "$TRAVIS_BUILD_TYPE" == "Profile" ]; then (cd build; lcov --remove coverage.info '/usr/*' 'tests/*' 'example/*' 'extern/*' 'idls/*' '*/harness/*' 'yarp/build/*' 'src/libYARP_serversql/*' 'src/libYARP_name/*' --output-file coverage.info); fi
# Debug before upload
- if [ "$TRAVIS_BUILD_TYPE" == "Profile" ]; then (cd build; lcov --list coverage.info); fi
# Uploads to coveralls
- if [ "$TRAVIS_BUILD_TYPE" == "Profile" ]; then (cd build; coveralls-lcov --source-encoding=ISO-8859-1 coverage.info); fi