-
Notifications
You must be signed in to change notification settings - Fork 6
/
.travis.yml
105 lines (105 loc) · 3.6 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
99
100
101
102
103
104
105
sudo: false
language: cpp
before_install:
- |
if [ ! -z "$encrypted_e845a59f36e1_key" -a ! -z "$encrypted_e845a59f36e1_iv" ] ; then
if $ANALYSIS || $COVERAGE || $DOXYGEN; then
openssl aes-256-cbc -K $encrypted_e845a59f36e1_key -iv $encrypted_e845a59f36e1_iv -in travis/ithipages-publish-key.enc -out ~/.ssh/ithipages-publish-key -d && (
chmod u=rw,og= ~/.ssh/ithipages-publish-key
echo "Host github.com" >> ~/.ssh/config
echo " IdentityFile ~/.ssh/ithipages-publish-key" >> ~/.ssh/config
( cd /tmp
git clone [email protected]:private-octopus/ithipages.git
cd ithipages
git checkout gh-pages
ls -l
)
)
fi
fi
addons:
apt:
packages:
- python
- valgrind
- lcov
- doxygen
- graphviz
matrix:
include:
- os: linux
compiler: gcc
env: VALGRIND=true ANALYSIS=true COVERAGE=true DOXYGEN=true
- os: linux
compiler: clang
env: VALGRIND=true ANALYSIS=false COVERAGE=false DOXYGEN=false
- os: osx
compiler: gcc
env: VALGRIND=false ANALYSIS=false COVERAGE=false DOXYGEN=false
- os: osx
compiler: clang
env: VALGRIND=false ANALYSIS=false COVERAGE=false DOXYGEN=false
script:
- |
if [ ! -z "$encrypted_e845a59f36e1_key" -a ! -z "$encrypted_e845a59f36e1_iv" ] && $COVERAGE ; then
CXXFLAGS="-Wall -Wextra -Wpedantic -Werror -g -fprofile-arcs -ftest-coverage -O0" \
CFLAGS="-Wall -Wextra -Wpedantic -Werror -g -fprofile-arcs -ftest-coverage -O0" \
LDFLAGS="-lgcov --coverage" cmake .
elif $VALGRIND ; then
CXXFLAGS="-Wall -Wextra -Wpedantic -Werror -g" \
CFLAGS="-Wall -Wextra -Wpedantic -Werror -g" cmake .
else
CXXFLAGS="-Wall -Wextra -Wpedantic -Werror" \
CFLAGS="-Wall -Wextra -Wpedantic -Werror" cmake .
fi
- make -j 4
- ./ithitest
- python travis/check-dnsstats-tables.py
- if $VALGRIND ; then valgrind -v --error-exitcode=1 ./ithitest ; fi
- |
if $ANALYSIS ; then
mkdir analysis
( cd analysis
echo "gitdir: ../.git" > .git
git reset --hard
scan-build cmake .
mkdir -p /tmp/ithipages/analysis
scan-build -o /tmp/ithipages/analysis --status-bugs make
)
fi
- |
if [ ! -z "$encrypted_e845a59f36e1_key" -a ! -z "$encrypted_e845a59f36e1_iv" ] && $COVERAGE ; then
geninfo . -o ithitest.info
lcov --remove ithitest.info '/usr/include/*' -o ithi.info
if [ $TRAVIS_PULL_REQUEST = "false" ] ; then
THIS_BRANCH=$TRAVIS_BRANCH
else
THIS_BRANCH=$TRAVIS_PULL_REQUEST_BRANCH
fi
mkdir -p /tmp/ithipages/coverage/$THIS_BRANCH
genhtml ithi.info --output-directory /tmp/ithipages/coverage/$THIS_BRANCH
fi
- |
if $DOXYGEN ; then
if [ $TRAVIS_PULL_REQUEST = "false" ] ; then
if [ $TRAVIS_BRANCH = "master" ] ; then
doxygen travis/Doxyfile
fi
fi
fi
after_script:
- |
if [ ! -z "$encrypted_e845a59f36e1_key" -a ! -z "$encrypted_e845a59f36e1_iv" ] ; then
if $ANALYSIS || $COVERAGE || $DOXYGEN ; then
cp README.md /tmp/ithipages/README.md.orig
( cd /tmp/ithipages
./mkreadme.sh && (
[ -d analysis ] && git add analysis
[ -d coverage ] && git add coverage
[ -d doxygen ] && git add doxygen
git commit -a -m "update from travis at `date`" \
&& git push
)
)
fi
fi