forked from dmonopoly/gtest-cmake-example
-
Notifications
You must be signed in to change notification settings - Fork 19
/
Copy path.travis.yml
85 lines (77 loc) · 2.5 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
language: cpp
env:
global:
# Ubuntu version
- LINUX_DIST=bionic
- DEPS_DIR=${TRAVIS_BUILD_DIR}/deps
# Global build options and C++ flags
- CXX_FLAGS="-Wall -Wpedantic -Werror -Wno-variadic-macros -Wno-long-long -Wno-shadow"
# Misc
- RUN_TESTS=true
- COVERAGE=false
matrix:
include:
- os: linux
dist: bionic
sudo: true
compiler:
- gcc
addons:
apt:
packages:
- gcc-7
- g++-7
- valgrind
# Misc
- python-yaml
- lcov
- libopencv-dev
sources:
- ubuntu-toolchain-r-test
# - os: linux
# dist: bionic
# sudo: true
# compiler:
# - clang
# addons:
# apt:
# packages:
# - clang-6.0
# - valgrind
# # Misc
# - python-yaml
# - lcov
# - libopencv-dev
# sources:
# - ubuntu-toolchain-r-test
before_install:
# Combine global build options with OS/compiler-dependent options
- export CMAKE_OPTIONS=${CMAKE_OPTIONS}" "${ENV_CMAKE_OPTIONS}
- export CXX_FLAGS=${CXX_FLAGS}" "${ENV_CXX_FLAGS}
install:
- if [ "$CXX" = "clang++" ] && [ "$TRAVIS_OS_NAME" = "linux" ]; then export CXX="clang++-6.0" CC="clang-6.0"; fi
- echo ${PATH}
- echo ${CXX}
- ${CXX} --version
- ${CXX} -v
- sudo pip install codecov
# Download and install recent cmake
- |
if [[ ${TRAVIS_OS_NAME} == "linux" ]]; then
CMAKE_URL="https://github.com/Kitware/CMake/releases/download/v3.20.2/cmake-3.20.2-linux-x86_64.tar.gz"
mkdir -p ${DEPS_DIR}/cmake
travis_retry wget --no-check-certificate --quiet -O - ${CMAKE_URL} | tar --strip-components=1 -xz -C ${DEPS_DIR}/cmake
export PATH=${DEPS_DIR}/cmake/bin:${PATH}
fi
script:
############################################################################
# Build main and tests
############################################################################
- mkdir -p build
- cd build
- cmake ${CMAKE_OPTIONS} -DCMAKE_CXX_FLAGS=${CXX_FLAGS} -DCMAKE_BUILD_TYPE=Coverage -DBUILD_TESTS=ON ..
- make
- make project1_coverage
- ctest
after_success:
- codecov -t c376990f-2ad6-4f7b-bbdb-5378a52e295c -X gcov