-
Notifications
You must be signed in to change notification settings - Fork 0
/
.travis.yml
89 lines (80 loc) · 2.97 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
# CI pipelines for testing the coverage target and uploading coverage report.
language: cpp
dist: trusty
notifications:
email: false
matrix:
##########################################################################
# Build with the main configuration on all the supported compilers
##########################################################################
include:
- os: linux
addons:
apt:
sources:
- ubuntu-toolchain-r-test
packages:
- lcov
- g++-7
env:
- MATRIX_EVAL="CXX_COMPILER=g++-7; sudo update-alternatives --install /usr/bin/gcov gcov /usr/bin/gcov-7 90"
- os: linux
addons:
apt:
sources:
- ubuntu-toolchain-r-test
packages:
- lcov
- g++-8
env:
- MATRIX_EVAL="CXX_COMPILER=g++-8; sudo update-alternatives --install /usr/bin/gcov gcov /usr/bin/gcov-8 90"
- os: osx
osx_image: xcode11
addons:
homebrew:
packages:
- lcov
update: true
env:
- MATRIX_EVAL="CXX_COMPILER=clang++"
install:
############################################################################
# All the dependencies are installed in ${HOME}/deps/
############################################################################
- DEPS_DIR="${HOME}/deps"
- mkdir -p ${DEPS_DIR} && cd ${DEPS_DIR}
############################################################################
# Install recent version of cmake
############################################################################
- |
if [[ "${TRAVIS_OS_NAME}" == "linux" ]]; then
CMAKE_URL="https://cmake.org/files/v3.20/cmake-3.20.0-linux-x86_64.tar.gz"
mkdir cmake
travis_retry wget --no-check-certificate --quiet ${CMAKE_URL}
tar --strip-components=1 -xzf cmake-3.20.0-linux-x86_64.tar.gz -C cmake
export PATH=${DEPS_DIR}/cmake/bin:${PATH}
else
brew install cmake || brew upgrade cmake
fi
- cmake --version
############################################################################
# Install coverals gem for uploading coverage to coveralls.
############################################################################
- gem install coveralls-lcov
before_script:
############################################################################
# Setup the build directory
############################################################################
- eval "${MATRIX_EVAL}"
- cd "${TRAVIS_BUILD_DIR}"
- mkdir build
- cd build
- cmake .. -DCMAKE_BUILD_TYPE=Coverage -DCMAKE_CXX_COMPILER=$CXX_COMPILER
- make
script:
- make coverage
after_success:
- cd "${TRAVIS_BUILD_DIR}/build"
- lcov --list coverage_out.info.cleaned # Show test report in travis log.
- coveralls-lcov coverage_out.info.cleaned # uploads to coveralls
- bash <(curl -s https://codecov.io/bash) -f coverage_out.info.cleaned || echo "Codecov did not collect coverage reports"