-
Notifications
You must be signed in to change notification settings - Fork 3
/
.travis.yml
90 lines (81 loc) · 2.55 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
language: cpp
sudo: false
# ignore tags
branches:
except:
- /^v[0-9]/
matrix:
include:
- os: linux
addons:
apt:
sources:
- ubuntu-toolchain-r-test
packages:
- g++-8
- lcov
env:
- MATRIX_EVAL="CXX=g++-8 && BUILD_TYPE=Coverage"
- os: linux
addons:
apt:
sources:
- ubuntu-toolchain-r-test
- llvm-toolchain-trusty-6.0
- sourceline: 'deb http://apt.llvm.org/trusty/ llvm-toolchain-trusty-6.0 main'
key_url: 'https://apt.llvm.org/llvm-snapshot.gpg.key'
packages:
- clang-6.0
- libstdc++-8-dev
env:
- MATRIX_EVAL="CXX=clang++-6.0 && BUILD_TYPE=Release"
- os: osx
osx_image: xcode9.4
env:
- MATRIX_EVAL="CC=clang && CXX=clang++ && BUILD_TYPE=Release"
cache:
directories:
- /usr/local/Cellar/llvm@7/7.0.1
timeout: 1000
install:
- |
if [ "${TRAVIS_OS_NAME}" = "osx" ]; then
if [ -e /usr/local/Cellar/llvm@7/7.0.1/bin ]; then
echo "Clang cache found."
ln -sf /usr/local/Cellar/llvm@7/7.0.1 /usr/local/opt/llvm@7
else
echo "Installing clang..."
rm -rf /usr/local/Cellar/llvm@7/7.0.1
brew install llvm@7
ls -l /usr/local/Cellar/llvm@7/7.0.1
fi
CC_PREFIX=/usr/local/opt/llvm@7
export PATH="${CC_PREFIX}/bin:$PATH"
export LDFLAGS="-L${CC_PREFIX}/lib -Wl,-rpath,${CC_PREFIX}/lib"
export CPPFLAGS="-I${CC_PREFIX}/include"
fi
before_script:
- eval "${MATRIX_EVAL}"
- $CXX --version
- mkdir -p build && cd build
script:
# Run cmake, then compile and run tests with make
- cmake -DCMAKE_BUILD_TYPE=${BUILD_TYPE} -DBUILD_TEST=ON ..;
- make VERBOSE=1
- ctest -V
# code coverage
after_success:
- if [ "${BUILD_TYPE}" == "Coverage" ]; then
git clone https://github.com/linux-test-project/lcov;
pushd lcov;
git checkout e675080;
popd;
./lcov/bin/lcov --gcov-tool `which gcov-8` -c -d src/CMakeFiles/cppglob.dir -b ../src -o coverage.info;
./lcov/bin/lcov --remove coverage.info '/usr/*' -o coverage.info;
./lcov/bin/lcov --list coverage.info;
bash <(curl -s https://codecov.io/bash) || echo "Codecov did not collect coverage reports";
fi
after_failure:
# Dumps any logs so you can read the stderr
- if [[ -e 'Testing/Temporary/LastTest.log' ]]; then cat 'Testing/Temporary/LastTest.log'; fi
- if [[ -e 'CMakeFiles/CMakeError.log' ]]; then cat 'CMakeFiles/CMakeError.log'; fi