159 lines
5.7 KiB
YAML
159 lines
5.7 KiB
YAML
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+=" -DBUILD_TESTING=OFF -DPYTHON_BINDINGS=OFF"; 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 )
|
|
- if $LINUX; then ( cd tools/clientSimulator &&
|
|
echo "TODO - install the generated .deb instead of using \$HOME/install."
|
|
"This would permit to test the packaging" &&
|
|
cmake $MY_CMAKE_OPTIONS . &&
|
|
make &&
|
|
make install ); fi
|
|
# 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 .. &&
|
|
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"
|