forked from tklengyel/drakvuf
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.travis.yml
345 lines (331 loc) · 12.2 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
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
dist: bionic
language: c
compiler: clang
services:
- docker
git:
submodules: false
jobs:
include:
#
# Whitespace check
#
- env:
- TEST="whitespace"
script:
- git remote add upstream https://github.com/$TRAVIS_REPO_SLUG.git
- git fetch upstream
- git diff --check upstream/master
#
# Astyle check
#
- env:
- TEST="astyle"
before_install:
- sudo apt-get update
- sudo apt-get -q -y install astyle
script:
- export ARTISTIC_STYLE_OPTIONS=".astylerc" && astyle -Q `find . -name "*.c" -o -name ".h" -o -name ".cpp" -name ".hpp"` > astyle.out
- TEST=$(cat astyle.out | wc -l)
- |
if [[ $TEST -ne 0 ]]; then
cat astyle.out
git --no-pager diff
echo "Please fix style issues as shown above"
exit 1
fi
#
# cppcheck
#
- env:
- TEST="cppcheck"
addons:
snaps:
- cppcheck
script:
- cppcheck --error-exitcode=1 --force ./src
#
# compile tests
#
- env:
- TEST="compile"
before_install:
- sudo apt-get update
- sudo apt-get -q -y install bison flex libjson-c-dev autoconf-archive libxen-dev
- export INSTALLDIR=$PWD/usr/local/
- export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$PWD/usr/local/lib
- export C_INCLUDE_PATH=$PWD/usr/local/include
- export CPLUS_INCLUDE_PATH=$PWD/usr/local/include
- export PKG_CONFIG_PATH="$PWD/usr/local/lib/pkgconfig/"
- export LDFLAGS="-L$PWD/usr/local/lib"
- export CFLAGS="-I$PWD/usr/local/include"
- git submodule update --init libvmi
- cd libvmi
- autoreconf -vif
- ./configure --prefix=${INSTALLDIR} --disable-kvm --disable-file --disable-bareflank --disable-safety-checks
- make
- make install
- cd ..
install:
- ./autogen.sh
script:
- ./configure --prefix=${INSTALLDIR} || cat config.log
- make
- make install
- env:
- TEST="compile with plugin disabled"
before_install:
- sudo apt-get update
- sudo apt-get -q -y install bison flex libjson-c-dev autoconf-archive libxen-dev
- export INSTALLDIR=$PWD/usr/local/
- export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$PWD/usr/local/lib
- export C_INCLUDE_PATH=$PWD/usr/local/include
- export CPLUS_INCLUDE_PATH=$PWD/usr/local/include
- export PKG_CONFIG_PATH="$PWD/usr/local/lib/pkgconfig/"
- export LDFLAGS="-L$PWD/usr/local/lib"
- export CFLAGS="-I$PWD/usr/local/include"
- git submodule update --init libvmi
- cd libvmi
- autoreconf -vif
- ./configure --prefix=${INSTALLDIR} --disable-kvm --disable-file --disable-bareflank --disable-safety-checks
- make
- make install
- cd ..
install:
- ./autogen.sh
script:
- ./configure --prefix=${INSTALLDIR} --disable-plugin-syscalls || cat config.log
- make
- make install
- env:
- TEST="compile debug"
before_install:
- sudo apt-get update
- sudo apt-get -q -y install bison flex libjson-c-dev autoconf-archive libxen-dev
- export INSTALLDIR=$PWD/usr/local/
- export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$PWD/usr/local/lib
- export C_INCLUDE_PATH=$PWD/usr/local/include
- export CPLUS_INCLUDE_PATH=$PWD/usr/local/include
- export PKG_CONFIG_PATH="$PWD/usr/local/lib/pkgconfig/"
- export LDFLAGS="-L$PWD/usr/local/lib"
- export CFLAGS="-I$PWD/usr/local/include"
- git submodule update --init libvmi
- cd libvmi
- autoreconf -vif
- ./configure --prefix=${INSTALLDIR} --disable-kvm --disable-file --disable-bareflank --disable-safety-checks
- make
- make install
- cd ..
install:
- ./autogen.sh
script:
- ./configure --prefix=${INSTALLDIR} --enable-debug --enable-sanitize || cat config.log
- make
- make install
- env:
- TEST="compile debug with plugin disabled"
before_install:
- sudo apt-get update
- sudo apt-get -q -y install bison flex libjson-c-dev autoconf-archive libxen-dev
- export INSTALLDIR=$PWD/usr/local/
- export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$PWD/usr/local/lib
- export C_INCLUDE_PATH=$PWD/usr/local/include
- export CPLUS_INCLUDE_PATH=$PWD/usr/local/include
- export PKG_CONFIG_PATH="$PWD/usr/local/lib/pkgconfig/"
- export LDFLAGS="-L$PWD/usr/local/lib"
- export CFLAGS="-I$PWD/usr/local/include"
- git submodule update --init libvmi
- cd libvmi
- autoreconf -vif
- ./configure --prefix=${INSTALLDIR} --disable-kvm --disable-file --disable-bareflank --disable-safety-checks
- make
- make install
- cd ..
install:
- ./autogen.sh
script:
- ./configure --prefix=${INSTALLDIR} --enable-debug --disable-plugin-syscalls || cat config.log
- make
- make install
- env:
- TEST="compile from make dist tarball"
before_install:
- sudo apt-get update
- sudo apt-get -q -y install bison flex libjson-c-dev autoconf-archive libxen-dev
- export INSTALLDIR=$PWD/usr/local/
- export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$PWD/usr/local/lib
- export C_INCLUDE_PATH=$PWD/usr/local/include
- export CPLUS_INCLUDE_PATH=$PWD/usr/local/include
- export PKG_CONFIG_PATH="$PWD/usr/local/lib/pkgconfig/"
- export LDFLAGS="-L$PWD/usr/local/lib"
- export CFLAGS="-I$PWD/usr/local/include"
- git submodule update --init libvmi
- cd libvmi
- autoreconf -vif
- ./configure --prefix=${INSTALLDIR} --disable-kvm --disable-file --disable-bareflank --disable-safety-checks
- make
- make install
- cd ..
script:
- ./autogen.sh
- ./configure --prefix=${INSTALLDIR} || cat config.log
- make dist
- mkdir build && cd build
- tar xvf ../drakvuf-*.tar.gz
- cd *drakvuf*
- ./autogen.sh
- ./configure --prefix=${INSTALLDIR} || cat config.log
- make
- make install
- env:
- TEST="compile debug with REPL enabled"
before_install:
- sudo apt-get update
- sudo apt-get -q -y install bison flex libjson-c-dev autoconf-archive libxen-dev python3-dev python3-pip python3-setuptools
- sudo pip3 install ctypesgen ipython
- export INSTALLDIR=$PWD/usr/local/
- export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$PWD/usr/local/lib
- export C_INCLUDE_PATH=$PWD/usr/local/include
- export CPLUS_INCLUDE_PATH=$PWD/usr/local/include
- export PKG_CONFIG_PATH="$PWD/usr/local/lib/pkgconfig/"
- export LDFLAGS="-L$PWD/usr/local/lib"
- export CFLAGS="-I$PWD/usr/local/include"
- git submodule update --init libvmi
- cd libvmi
- autoreconf -vif
- ./configure --prefix=${INSTALLDIR} --disable-kvm --disable-file --disable-bareflank --disable-safety-checks
- make
- make install
- cd ..
install:
- ./autogen.sh
script:
- ./configure --enable-debug --enable-sanitize --enable-repl || cat config.log
- make
#
# clang scan-build
#
- env:
- TEST="scan-build"
addons:
apt:
sources:
- sourceline: 'deb http://apt.llvm.org/bionic/ llvm-toolchain-bionic-10 main'
key_url: https://apt.llvm.org/llvm-snapshot.gpg.key
- ubuntu-toolchain-r-test
packages:
- clang-10
- clang-tools-10
before_install:
- sudo apt-get update
- sudo apt-get -q -y install bison flex libjson-c-dev autoconf-archive libxen-dev
- export INSTALLDIR=$PWD/usr/local/
- export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$PWD/usr/local/lib
- export C_INCLUDE_PATH=$PWD/usr/local/include
- export CPLUS_INCLUDE_PATH=$PWD/usr/local/include
- export PKG_CONFIG_PATH="$PWD/usr/local/lib/pkgconfig/"
- export LDFLAGS="-L$PWD/usr/local/lib"
- export CFLAGS="-I$PWD/usr/local/include"
- export PATH=$PATH:/usr/lib/llvm-10/bin
install:
- git submodule update --init libvmi
- cd libvmi
- autoreconf -vif
- ./configure --prefix=${INSTALLDIR} --disable-kvm --disable-file --disable-bareflank --disable-safety-checks
- make
- make install
- cd ..
- ./autogen.sh
script:
- scan-build-10 --status-bugs --use-cc=clang-10 --use-c++=clang++-10 -analyze-headers -disable-checker deadcode.DeadStores ./configure --enable-debug
- scan-build-10 --status-bugs --use-cc=clang-10 --use-c++=clang++-10 -analyze-headers -disable-checker deadcode.DeadStores make
#
# Coverity
#
- if: branch = master
env:
- TEST="Coverity"
addons:
coverity_scan:
project:
name: "$COVERITY_PROJECT_NAME"
description: "Build submitted via Travis CI"
notification_email: $COVERITY_NOTIFICATION_EMAIL
build_command_prepend: "./autogen.sh; ./configure --enable-debug; make clean"
build_command: "make"
branch_pattern: $COVERITY_BRANCH_PATTERN
before_install:
- sudo apt-get update
- sudo apt-get -q -y install bison flex libjson-c-dev autoconf-archive libxen-dev
- export INSTALLDIR=$PWD/usr/local/
- export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$PWD/usr/local/lib
- export C_INCLUDE_PATH=$PWD/usr/local/include
- export CPLUS_INCLUDE_PATH=$PWD/usr/local/include
- export PKG_CONFIG_PATH="$PWD/usr/local/lib/pkgconfig/"
- export LDFLAGS="-L$PWD/usr/local/lib"
- export CFLAGS="-I$PWD/usr/local/include"
- git submodule update --init libvmi
- cd libvmi
- autoreconf -vif
- ./configure --prefix=${INSTALLDIR} --disable-kvm --disable-file --disable-bareflank --disable-safety-checks
- make
- make install
- cd ..
script:
- echo -n | openssl s_client -connect scan.coverity.com:443 | sed -ne '/-BEGIN CERTIFICATE-/,/-END CERTIFICATE-/p' | sudo tee -a /etc/ssl/certs/ca-
#
# SonarCloud
#
- if: branch = master
env:
- TEST="SonarCloud"
addons:
sonarcloud:
organization: "drakvuf"
token: "$SONAR_TOKEN"
script:
- 'if [ "$TRAVIS_PULL_REQUEST" != "false" ]; then exit 0; fi'
- sudo apt-get update
- sudo apt-get -q -y install bison flex libjson-c-dev autoconf-archive libxen-dev
- export INSTALLDIR=$PWD/usr/local/
- export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$PWD/usr/local/lib
- export C_INCLUDE_PATH=$PWD/usr/local/include
- export CPLUS_INCLUDE_PATH=$PWD/usr/local/include
- export PKG_CONFIG_PATH="$PWD/usr/local/lib/pkgconfig/"
- export LDFLAGS="-L$PWD/usr/local/lib"
- export CFLAGS="-I$PWD/usr/local/include"
- git submodule update --init libvmi
- cd libvmi
- autoreconf -vif
- ./configure --prefix=${INSTALLDIR} --disable-kvm --disable-file --disable-bareflank --disable-safety-checks
- make
- make install
- cd ..
- ./autogen.sh
- ./configure --enable-debug
- build-wrapper-linux-x86-64 --out-dir bw-output make -j2
- sonar-scanner
#
# Build binary packages and push them as releases on drakvuf-builds
#
- if: branch = master
env:
- TEST="package build"
script:
- 'if [ "$TRAVIS_PULL_REQUEST" != "false" ]; then exit 0; fi'
- git submodule update --init libvmi xen
- travis_wait 60 sh package/build.sh;
cache:
directories:
- package/cache
before_deploy:
- git config --local user.name "drakvuf-builds"
- git config --local user.email "drakvuf-builds@tklsoftware.com"
- export TRAVIS_TAG=${TRAVIS_TAG:-$(date +'%Y%m%d%H%M%S')-$(git log --format=%h -1)}
- git tag $TRAVIS_TAG
deploy:
provider: releases
edge: true
repo: tklengyel/drakvuf-builds
file:
- package/out/**/*