-
Notifications
You must be signed in to change notification settings - Fork 1
/
.travis.yml
81 lines (73 loc) · 2.07 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
dist: xenial
language: c++
services:
- docker
addons:
apt:
packages:
- valgrind
matrix:
include:
- os: linux # travis ubuntu xenial
env:
- MYCXX="g++"
- USE_DOCKER="FALSE"
- USE_GCOV="TRUE"
- os: linux # arch linux docker
env:
- MYCXX="g++"
- USE_DOCKER="TRUE"
- USE_GCOV="FALSE"
- os: osx
osx_image: xcode11
env:
- MYCXX="g++"
- USE_DOCKER="FALSE"
- USE_GCOV="FALSE"
- os: osx
osx_image: xcode11
env:
- MYCXX="clang++"
- USE_DOCKER="FALSE"
- USE_GCOV="FALSE"
before_install:
- |
if [[ "$USE_DOCKER" == "TRUE" ]]; then
docker pull nnvmc/base;
else
${MYCXX} -v;
fi;
echo "CXX_COMPILER=${MYCXX}" >> config.sh;
echo "CXX_FLAGS=\"-O0 -g -Wall -Wno-unused-function ${configopt}\"" >> config.sh;
if [[ "$USE_GCOV" == "TRUE" ]];
then echo "USE_COVERAGE=1" >> config.sh;
else
echo "USE_COVERAGE=0" >> config.sh;
fi;
script:
- |
if [[ "$USE_DOCKER" == "TRUE" ]]; then
docker run -it -v $(pwd):/root/repo nnvmc/base /bin/bash -c "cd /root/repo && ./build.sh" || exit 1;
else
./build.sh || exit 1;
fi;
- |
if [[ "$USE_DOCKER" == "TRUE" ]]; then
if [[ "$USE_GCOV" == "TRUE" ]]; then
docker run -it -v $(pwd):/root/repo nnvmc/base /bin/bash -c "cd /root/repo/build && make test";
docker run -e TRAVIS=$TRAVIS -e TRAVIS_JOB_ID=$TRAVIS_JOB_ID -it -v $(pwd):/root/repo nnvmc/base /bin/bash -c "pip install cpp-coveralls && cd /root/repo/build && coveralls -b ./ -r ../ -i include -i src -x .cpp -x .hpp --gcov-options '\-lp'";
else
docker run -it -v $(pwd):/root/repo nnvmc/base /bin/bash -c "cd /root/repo/test && ./run.sh";
fi;
else
if [[ "$USE_GCOV" == "TRUE" ]]; then
cd build && make test;
sudo pip install cpp-coveralls && coveralls -b ./ -r ../ -i include -i src -x .cpp -x .hpp --gcov-options '\-lp' && cd .. ;
else
cd test && ./run.sh && cd .. ;
fi;
fi;
notifications:
email:
on_success: change
on_failure: change