-
Notifications
You must be signed in to change notification settings - Fork 19
/
.travis.yml
98 lines (88 loc) · 2.82 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
language: cpp
dist: xenial
matrix:
include:
- os: linux
compiler: clang
addons: &clang
apt:
sources:
- ubuntu-toolchain-r-test
- llvm-toolchain-xenial-8
packages:
- g++-8
- llvm-8-dev
- clang-8
- clang++-8
- lcov
env:
- MATRIX_EVAL="CC=clang-8 && CXX=clang++-8"
- BUILD_TYPE=Release
- os: linux
compiler: clang
addons: *clang
env:
- MATRIX_EVAL="CC=clang-8 && CXX=clang++-8"
- BUILD_TYPE=Debug
- os: linux
compiler: clang
addons: *clang
env:
- COVERAGE=1
- MATRIX_EVAL="CC=clang-8 && CXX=clang++-8"
- BUILD_TYPE=Debug
- CXX_FLAGS=--coverage
- os: linux
compiler: gcc
addons: &gcc8
apt:
sources:
- ubuntu-toolchain-r-test
- llvm-toolchain-xenial-8
packages:
- g++-8
- llvm-8-dev
env:
- MATRIX_EVAL="CC=gcc-8 && CXX=g++-8"
- BUILD_TYPE=Release
- os: linux
compiler: gcc
addons: *gcc8
env:
- MATRIX_EVAL="CC=gcc-8 && CXX=g++-8"
- BUILD_TYPE=Debug
- os: osx
compiler: clang
osx_image: xcode10.2
env:
- BUILD_TYPE=Release
- os: osx
compiler: clang
osx_image: xcode10.2
env:
- BUILD_TYPE=Debug
install:
- eval "${MATRIX_EVAL}"
- if [ $TRAVIS_OS_NAME = 'osx' ]; then
brew install llvm@8;
export PATH="/usr/local/opt/llvm/bin:$PATH";
export LDFLAGS="-L/usr/local/opt/llvm/lib -Wl,-rpath,/usr/local/opt/llvm/lib";
fi
- mkdir build
- cd build
- (curl https://codeload.github.com/google/googletest/tar.gz/release-1.8.1 | tar -xzf - && cd googletest-release-1.8.1 && mkdir build && cd build && cmake .. -DCMAKE_BUILD_TYPE=Release && make && sudo make install);
- (curl https://codeload.github.com/fmtlib/fmt/tar.gz/5.3.0 | tar -xzf - && cd fmt-5.3.0 && mkdir build && cd build && cmake .. -DCMAKE_BUILD_TYPE=Release -DFMT_TEST=OFF -DFMT_DOC=OFF && make && sudo make install);
script:
- cmake .. -DCMAKE_BUILD_TYPE=${BUILD_TYPE} -DCODEGEN_SANITIZERS=OFF -DCMAKE_CXX_FLAGS=${CXX_FLAGS}
- make VERBOSE=1
- make test
after_script:
- if [[ "${COVERAGE}" == 1 ]]; then
cd ${TRAVIS_BUILD_DIR};
echo -e '#!/bin/bash\nexec llvm-cov-8 gcov "$@"' > ${TRAVIS_BUILD_DIR}/llvm-gcov.sh;
chmod +x ${TRAVIS_BUILD_DIR}/llvm-gcov.sh;
lcov --directory . --capture --output-file coverage.info --gcov-tool ${TRAVIS_BUILD_DIR}/llvm-gcov.sh;
lcov --remove coverage.info '/usr/*' --output-file coverage.info;
lcov --list coverage.info;
bash <(curl -s https://codecov.io/bash) -x ${TRAVIS_BUILD_DIR}/llvm-gcov.sh || echo "Codecov did not collect coverage reports";
fi