forked from ebu/libear
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.travis.yml
98 lines (89 loc) · 3.21 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
sudo: false
language: cpp
matrix:
include:
- os: linux
sudo: required
services: docker
env: DOCKER_IMAGE=debian:latest BUILD_SHARED_LIBS=ON CMAKE_BUILD_TYPE=Release
- os: linux
sudo: required
services: docker
env: DOCKER_IMAGE=debian:latest BUILD_SHARED_LIBS=OFF CMAKE_BUILD_TYPE=Release
- os: linux
sudo: required
services: docker
env: DOCKER_IMAGE=ubuntu:latest BUILD_SHARED_LIBS=ON CMAKE_BUILD_TYPE=Release
- os: linux
sudo: required
services: docker
env: DOCKER_IMAGE=ubuntu:latest BUILD_SHARED_LIBS=OFF CMAKE_BUILD_TYPE=Release
- os: linux
sudo: required
services: docker
env: DOCKER_IMAGE=fedora:latest BUILD_SHARED_LIBS=ON CMAKE_BUILD_TYPE=Release
- os: linux
sudo: required
services: docker
env: DOCKER_IMAGE=fedora:latest BUILD_SHARED_LIBS=OFF CMAKE_BUILD_TYPE=Release
- os: osx
osx_image: xcode10.2
env: BUILD_SHARED_LIBS=ON CMAKE_BUILD_TYPE=Release
- os: osx
osx_image: xcode10.2
env: BUILD_SHARED_LIBS=OFF CMAKE_BUILD_TYPE=Release
- os: linux
sudo: required
services: docker
env: DOCKER_IMAGE=debian:9 BUILD_SHARED_LIBS=OFF CMAKE_BUILD_TYPE=Coverage
before_install:
- |
if [[ "${TRAVIS_OS_NAME}" == "linux" ]]; then
docker run -d --name linux -v $(pwd):/travis $DOCKER_IMAGE tail -f /dev/null;
docker ps
fi
install:
# install dependencies in debian like systems
- |
if [[ "$DOCKER_IMAGE" == *"ubuntu"* || "$DOCKER_IMAGE" == *"debian"* ]]; then
docker exec -t linux bash -c "apt-get update &&
apt-get install -y build-essential cmake ninja-build libboost-dev libyaml-cpp-dev"
fi
# install dependencies in red hat like systems
- |
if [[ "$DOCKER_IMAGE" == *"fedora"* ]]; then
docker exec -t linux bash -c "dnf -y group install \"Development Tools\" \"C Development Tools and Libraries\" &&
dnf -y install cmake ninja-build boost-devel yaml-cpp-devel"
fi
# install dependencies for coverage
- |
if [[ "$DOCKER_IMAGE" == *"debian"* && "${CMAKE_BUILD_TYPE}" == "Coverage" ]]; then
docker exec -t linux bash -c "apt-get update &&
apt-get install -y git python-pip &&
pip install codecov"
fi
script:
- |
if [[ "${TRAVIS_OS_NAME}" == "linux" ]]; then
docker exec -t linux bash -c "cd /travis;
mkdir build && cd build && cmake -G Ninja -DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE} -DBUILD_SHARED_LIBS=${BUILD_SHARED_LIBS} .. &&
ninja && ctest --output-on-failure"
fi
- |
if [[ "${TRAVIS_OS_NAME}" == "osx" ]]; then
cd "${TRAVIS_BUILD_DIR}"
brew install yaml-cpp &&
mkdir build && cd build && cmake -DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE} -DBUILD_SHARED_LIBS=${BUILD_SHARED_LIBS} .. &&
make -j2 && ctest --output-on-failure
fi
after_success:
- |
if [[ "${TRAVIS_OS_NAME}" == "linux" && "${CMAKE_BUILD_TYPE}" == "Coverage" ]]; then
docker exec -t linux bash -c "cd /travis && codecov \
--token ${CODECOV_UPLOAD_TOKEN} \
--branch ${TRAVIS_BRANCH} \
--build ${TRAVIS_JOB_NUMBER} \
--pr ${TRAVIS_PULL_REQUEST} \
--slug ${TRAVIS_REPO_SLUG} \
--commit ${TRAVIS_COMMIT}"
fi