-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy path.travis.yml
89 lines (83 loc) · 2.25 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
os: linux
dist: xenial
language: cpp
#env:
# global:
# # This flag may limit the parallel build of jobs
# - MAKEFLAGS="-j 4"
cache:
# ccache: true
directories:
- ${TRAVIS_BUILD_DIR}/lcov-1.14
- ${TRAVIS_BUILD_DIR}/grpc
before_cache:
- sh ${TRAVIS_BUILD_DIR}/script/clean_cache.sh ${TRAVIS_BUILD_DIR}/
addons:
apt:
update: true
packages:
- autoconf
- automake
- build-essential
- cmake
- clang-6.0
- curl
- g++
- make
- libc++-dev
- libcurl3-dev
- libgflags-dev
- libgtest-dev
- libtool
- pkg-config
- unzip
- cppcheck
install:
# lcov
- sh ${TRAVIS_BUILD_DIR}/script/install_lcov.sh ${TRAVIS_BUILD_DIR}/
# gRPC and Protobuf
- sh ${TRAVIS_BUILD_DIR}/script/clone_grpc.sh ${TRAVIS_BUILD_DIR}/
# Protobuf
- sh ${TRAVIS_BUILD_DIR}/script/install_protobuf.sh ${TRAVIS_BUILD_DIR}/
# gRPC
- sh ${TRAVIS_BUILD_DIR}/script/install_grpc.sh ${TRAVIS_BUILD_DIR}/
- pip install --user cpp-coveralls
before_script:
- cd ${TRAVIS_BUILD_DIR}
- lcov --directory . --zerocounters
compiler:
- g++
jobs:
include:
- stage: build
script:
- cd ${TRAVIS_BUILD_DIR}/spec/cpp
- mkdir build
- cd build
- cmake -DBUILD_TESTS=ON -DCOVERAGE=1 ..
- make
- GTEST_COLOR=1 ctest --extra-verbose
# - stage: test
# script:
# - cd ${TRAVIS_BUILD_DIR}/spec/cpp
# - mkdir build
# - cd build
# - cmake -DBUILD_TESTS=ON ..
# - make
# - GTEST_COLOR=1 ctest --extra-verbose
after_success:
- cd ${TRAVIS_BUILD_DIR}/spec/cpp/build
- rm -rf tests/libgtest/googletest/CMakeFiles/gtest_main.dir/src/gtest_main.cc.gcda
- rm -rf tests/libgtest/googletest/CMakeFiles/gtest.dir/src/gtest-all.cc.gcda
# capture coverage info
- lcov --directory . --capture --output-file coverage.info
# filter out system and test code
- lcov --remove coverage.info '*/cpp/tests/*' '/usr/*' --output-file coverage.info
# debug before upload
- lcov --list coverage.info
# uploads to coveralls.. for a private repo using a token
# - coveralls-lcov --repo-token ${COVERALLS_TOKEN} coverage.info
# for open source
- coveralls-lcov coverage.info
notifications:
email: false