-
Notifications
You must be signed in to change notification settings - Fork 0
/
.travis.yml
147 lines (131 loc) · 4.09 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
language: cpp
env:
global:
- DEPS_DIR=${TRAVIS_BUILD_DIR}/deps
- BOOST_VERSION=1.65.1
- BOOST_URL="https://dl.bintray.com/boostorg/release/1.65.1/source/boost_1_65_1.tar.gz"
- CODECOV=no
cache:
directories:
- ${DEPS_DIR}
matrix:
include:
- os: linux
dist: trusty
sudo: false
env: CC_COMPILER=clang-4.0 CXX_COMPILER=clang++-4.0
addons:
apt:
update: true
sources:
- ubuntu-toolchain-r-test
- llvm-toolchain-trusty-4.0
packages:
- clang-4.0
- libstdc++-6-dev
- ninja-build
- os: linux
dist: trusty
sudo: false
env: CC_COMPILER=clang-5.0 CXX_COMPILER=clang++-5.0
addons:
apt:
update: true
sources:
- ubuntu-toolchain-r-test
- llvm-toolchain-trusty-5.0
packages:
- clang-5.0
- libstdc++-6-dev
- ninja-build
- os: linux
dist: trusty
sudo: false
env: CC_COMPILER=gcc-6 CXX_COMPILER=g++-6 CODECOV=no
addons:
apt:
update: true
sources:
- ubuntu-toolchain-r-test
packages:
- g++-6
- ninja-build
- lcov
- os: linux
dist: trusty
sudo: false
env: CC_COMPILER=gcc-7 CXX_COMPILER=g++-7 CODECOV=yes
addons:
apt:
update: true
sources:
- ubuntu-toolchain-r-test
packages:
- g++-7
- ninja-build
- lcov
- os: osx
osx_image: xcode9.3
env: BUILD_TYPE=Debug
before_install:
- |
if [[ "${TRAVIS_OS_NAME}" == "osx" ]]; then
brew update
fi
install:
# Download and install Boost
- |
if [[ ${TRAVIS_OS_NAME} == "linux" && ${BOOST_VERSION} != "default" ]]; then
if [ ! -f "${DEPS_DIR}/boost/${BOOST_VERSION}_cached" ]; then
# create dirs for source and install
mkdir -p ${DEPS_DIR}/boost${BOOST_VERSION}
mkdir -p ${DEPS_DIR}/boost
rm -rf ${DEPS_DIR}/boost/*
# download
travis_retry wget --no-check-certificate --quiet -O - ${BOOST_URL} | tar --strip-components=1 -xz -C ${DEPS_DIR}/boost${BOOST_VERSION}
pushd ${DEPS_DIR}/boost${BOOST_VERSION}
# configure and install
if [ "$CXX" = "${CXX_COMPILER}" ]; then echo "using cc : ${CC_COMPILER} : ${CXX_COMPILER} ;" > $HOME/user-config.jam; fi
./bootstrap.sh --prefix=${DEPS_DIR}/boost/ --with-libraries=system,program_options,date_time,filesystem,regex,log
./b2 -j 4 -d0 install
popd
rm -rf ${DEPS_DIR}/boost/include/boost/{compute,compute.hpp}
touch ${DEPS_DIR}/boost/${BOOST_VERSION}_cached
else
echo "Using cached Boost ${BOOST_VERSION} libraries."
fi
export CMAKE_OPTIONS=${CMAKE_OPTIONS}" -DBOOST_ROOT=${DEPS_DIR}/boost"
fi
# Setup compilers
- |
if [[ "${TRAVIS_OS_NAME}" == "linux" ]]; then
if [[ "${CC_COMPILER}" != "" ]]; then export CC=${CC_COMPILER}; fi
${CC} --version
if [[ "${CXX_COMPILER}" != "" ]]; then export CXX=${CXX_COMPILER}; fi
${CXX} --version
fi
# Update references on OSX
- |
if [[ "${TRAVIS_OS_NAME}" == "osx" ]]; then
brew install boost
brew install ninja
fi
# Setup code coverage for GCC builds
- |
if [[ "${CODECOV}" == "yes" ]]; then
export CMAKE_OPTIONS=${CMAKE_OPTIONS}" -DCMAKE_CXX_FLAGS=--coverage -DCMAKE_EXE_LINKER_FLAGS=--coverage"
fi
script:
- mkdir bin
- cd bin
- cmake -GNinja ${CMAKE_OPTIONS} ..
- cmake --build . --target all
- ctest --verbose
after_success:
# Creating report
- cd ${TRAVIS_BUILD_DIR}
- lcov --directory . --capture --output-file coverage.info # capture coverage info
- lcov --remove coverage.info '/usr/*' --output-file coverage.info # filter out system
- lcov --list coverage.info #debug info
# Uploading report to CodeCov
- bash <(curl -s https://codecov.io/bash) || echo "Codecov did not collect coverage reports"