This repository has been archived by the owner on Aug 5, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 48
/
.travis.yml
152 lines (142 loc) · 5.45 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
os:
- linux
- osx
# Use travis docker infrastructure
sudo: false
# Use a recent OSX image
# cf.
# https://docs.travis-ci.com/user/languages/objective-c/#Supported-OS-X-iOS-SDK-versions
osx_image: xcode7.2
language: cpp
cache: ccache
env:
global:
- PREFIX=$HOME/prefix
- MY_CMAKE_OPTIONS="-DCMAKE_PREFIX_PATH=$PREFIX -DCMAKE_INSTALL_PREFIX=$HOME/install"
- OSX_CMAKE_OPTIONS="-DBUILD_TESTING=OFF -DPYTHON_BINDINGS=OFF -DCLIENT_SIMULATOR=OFF"
- CTEST_OUTPUT_ON_FAILURE=1
- LINUX=false
- OSX=false
compiler:
- gcc
- clang
matrix:
exclude:
- os: osx
compiler: gcc
# Install a recent gcc and gcov,
# it will not be necessary once travis worker is based on ubuntu > 12.04.
# Install SWIG for bindings generation
# Install valgrind for memcheck tests
# Adding george-edison55-precise-backports ppa for for cmake 3.x.
# Install python3-dev for the client simulator
addons:
apt:
# Travis white list of ppa
# https://github.com/travis-ci/apt-source-whitelist/blob/master/ubuntu.json
sources:
- ubuntu-toolchain-r-test
- george-edison55-precise-backports
- llvm-toolchain-precise-3.8
# Travis white list of dpkg packages
# https://github.com/travis-ci/apt-package-whitelist/blob/master/ubuntu-precise
packages:
- swig
- valgrind
- g++-4.8
- cmake-data
- cmake
- python3-dev
- clang-format-3.8
before_install:
# OS detection
# TODO: an explicit build matrix may be better but it has limitation, e.g.
# each matrix entry may only define a single env variable.
- if [ $TRAVIS_OS_NAME = linux ]; then export LINUX=true; fi
- if [ $TRAVIS_OS_NAME = osx ]; then export OSX=true; fi
install:
- wget https://codecov.io/bash -O $HOME/codecov; chmod +x $HOME/codecov
# This version of catch is known to work.
- wget --directory-prefix $PREFIX/include
https://raw.github.com/philsquared/Catch/v1.2.1/single_include/catch.hpp
- wget -O asio-1.10.6.tar.gz https://github.com/chriskohlhoff/asio/archive/asio-1-10-6.tar.gz
- tar xf asio-1.10.6.tar.gz -C $PREFIX --strip-components=2 asio-asio-1-10-6/asio
# Current limitations on OSX builds: no testing, no client-simulator
# (because we haven't found a straightforward way to have CMake find the
# python libraries (find_package(PythonLibs)).
- if $OSX; then
brew update;
for package in cmake; do
if brew list $package; then
brew outdated $package || brew upgrade $package;
else
brew install $package;
fi;
done;
fi
before_script:
- coverage=OFF
# Force the manualy installed 4.8 version as it is not the default
# Only enable coverage on gcc as clang segfault on coverage file write
# Workaround a bug with the ccache/g++-4.8.1 combination
- if [ "$CC" = "gcc" ]; then
export CC=gcc-4.8 CXX=g++-4.8;
coverage=ON;
export CCACHE_CPP2=1;
fi
- if $OSX; then export MY_CMAKE_OPTIONS+=" $OSX_CMAKE_OPTIONS"; fi
# how to build
script:
# Check coding style
- if $LINUX; then (git ls-files | grep -E '\.[ch](pp)?$' | xargs clang-format-3.8 -i &&
git diff --exit-code || { git reset --hard; false; }); fi
- ( mkdir build_debug && cd build_debug &&
cmake $MY_CMAKE_OPTIONS -DCMAKE_BUILD_TYPE=Debug -DCOVERAGE=${coverage} .. &&
make -j$(nproc) &&
(if $LINUX; then make ExperimentalTest ExperimentalMemCheck; fi) )
- ( mkdir build && cd build &&
cmake $MY_CMAKE_OPTIONS -DCMAKE_BUILD_TYPE=Release .. &&
make -j$(nproc) &&
(if $LINUX; then make test; fi) &&
make install &&
(if $LINUX; then cpack --verbose -G DEB && dpkg --info *.deb; fi) )
- ( cd skeleton-subsystem &&
cmake $MY_CMAKE_OPTIONS -DCMAKE_BUILD_TYPE=Release . &&
make -j$(nproc) &&
(if $LINUX; then make ExperimentalTest ExperimentalMemCheck; fi) &&
make install )
# Check that all installed files are in a component (no "unspecified
# component" archive created)
- (cd build && cpack -G TGZ -D CPACK_ARCHIVE_COMPONENT_INSTALL=ON &&
[ ! -e "*-Unspecified.tar.gz" ])
# Keep this last
- ( mkdir build_less_features && cd build_less_features &&
rm -rf $PREFIX/asio-1.10.6 &&
cmake $MY_CMAKE_OPTIONS -DCMAKE_BUILD_TYPE=Debug
-DNETWORKING=OFF -DPYTHON_BINDINGS=OFF -DC_BINDINGS=OFF -DCLIENT_SIMULATOR=OFF .. &&
make -j$(nproc) &&
(if $LINUX; then make test; fi) )
after_success:
# Push coverage info on codecov.io.
# Ignore generated files, samples and tests
- if [ "${coverage}" = "ON" ]; then
$HOME/codecov
-g "*/build_debug/bindings/python/*"
-g "*/build_debug/CMakeFiles/*"
-g "*/build/*"
-g "*/install/*"
-g "*/skeleton-subsystem/*"
-g "*/tools/clientSimulator/*"
-g "*/test/test-subsystem/*"
-g "*/test/introspection-subsystem/*"
-g "*/test/functional-tests/*"
-g "*/test/tmpfile/*"
-g "*/test/tokenizer/*"
-g "*/bindings/c/Test.cpp"
-g "*/utility/test/*"
-x /usr/bin/gcov-4.8
-a '\--long-file-names --preserve-paths';
fi
notifications:
irc:
- "chat.freenode.net#parameter-framework"