-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy path.travis.yml
98 lines (87 loc) · 2.86 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
os: linux
dist: focal
arch:
- amd64
cache: # see https://docs.travis-ci.com/user/caching/
- directories:
- $HOME/.cache
env:
global:
- CMAKE_BUILD_TYPE=Coverage
jobs:
fast_finish: true
allow_failures:
- os: osx
- os: windows
include:
- os: osx
compiler: clang
osx_image: xcode11.6
- os: linux
compiler: clang
dist: focal
- os: linux
compiler: gcc
dist: focal
- os: windows
addons:
apt:
packages:
- g++-10
- clang-10
- clang-tools-10
- clang-format-10
- clang-tidy-10
- lcov
- cmake
homebrew:
packages:
- cmake
- lcov
update: true
#before_install:
# - ./.travis-ci.d/install_dependencies.sh
install:
- mkdir -p $HOME/.cache
# /usr/bin/gcc points to an older compiler on both Linux and macOS.
- if [ "$CXX" = "g++" ]; then export CXX="g++-10" CC="gcc-10"; fi
- if [ "$TRAVIS_OS_NAME" = "windows" ]; then choco install python; fi
# /usr/bin/clang points to an older compiler on both Linux and macOS.
#
# Homebrew's llvm package doesn't ship a versioned clang++ binary, so the values
# below don't work on macOS. Fortunately, the path change above makes the
# default values (clang and clang++) resolve to the correct compiler on macOS.
- if [ "$TRAVIS_OS_NAME" = "linux" ]; then pip install --upgrade cmake ; fi
- if [ "$TRAVIS_OS_NAME" = "linux" ]; then if [ "$CXX" = "clang++" ]; then export CXX="clang++-10" CC="clang-10"; fi; fi
script:
#- source dependencies/root/bin/thisroot.sh
- mkdir -p build && cd build
- if [ "$TRAVIS_OS_NAME" == "linux" ] && [ "$TRAVIS_COMPILER" == "gcc" ];
then cmake -DCMAKE_BUILD_TYPE="$CMAKE_BUILD_TYPE" .. ;
elif [ "$TRAVIS_OS_NAME" == "windows" ];
then cmake -G "Visual Studio 15 2017" -A x64 .. ;
else
cmake -DCMAKE_BUILD_TYPE="$CMAKE_BUILD_TYPE" .. ;
fi
# Build (for Make on Unix equivalent to `make -j $(nproc)`)
- cmake --build . --config "$CMAKE_BUILD_TYPE" --parallel $(nproc)
# Test
- ctest --parallel $(nproc) --output-on-failure -C "$CMAKE_BUILD_TYPE"
after_success:
# Create lcov report
# capture coverage info
- lcov --directory . --capture --output-file coverage.info
# filter out system and extra files.
# To also not include test code in coverage add them with full path to the patterns: '*/tests/*'
- lcov --remove coverage.info '/usr/*' "${HOME}"'/.cache/*' --output-file coverage.info
# output coverage data for debugging (optional)
- lcov --list coverage.info
# Uploading to CodeCov
# '-f' specifies file(s) to use and disables manual coverage gathering and file search which has already been done above
- bash <(curl -s https://codecov.io/bash) -f coverage.info || echo "Codecov did not collect coverage reports"
# Don't send e-mail notifications
notifications:
email:
on_success: never
on_failure: never