forked from cisco/libsrtp
-
Notifications
You must be signed in to change notification settings - Fork 1
/
.travis.yml
426 lines (404 loc) · 14.8 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
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
dist: xenial
language: c
env:
global:
- secure: "QD09MuUxftXRXtz7ZrB7S0NV/3O9yVhjvIlCSbXN8B87rNSDC8wxMThKMT7iZewnqGk53m+Up19PiMw5ERlHose5tm2cmY1FO/l+c9oAyWZaAL+4XNXryq6zI5F5FX5I61NbfqV3xcnfLTI2QIJF6WqDojNxhPjTbNzQGxIDuqw="
matrix:
include:
# linux build
- os: linux
env:
- TEST="linux (gcc / valgrind)"
addons:
apt:
sources:
- ubuntu-toolchain-r-test
packages:
- gcc-6
- valgrind
install:
- pyenv global 3.7.1
- pip3 install meson ninja
script:
- CC=gcc-6 EXTRA_CFLAGS=-Werror ./configure
- make
- make runtest
- make runtest-valgrind
- make distclean
- mkdir build && cd build
- cmake ..
- make
- make test
- cd ..
- CC=gcc-6 meson setup --werror builddir
- meson compile -C builddir
- meson test -v -C builddir
# linux build with openssl
- os: linux
env:
- TEST="linux openssl (gcc / valgrind)"
addons:
apt:
sources:
- ubuntu-toolchain-r-test
packages:
- gcc-6
- valgrind
install:
- pyenv global 3.7.1
- pip3 install meson ninja
script:
- CC=gcc-6 EXTRA_CFLAGS=-Werror ./configure --enable-openssl
- make
- make runtest
- make runtest-valgrind
- make distclean
- mkdir build && cd build
- cmake -DENABLE_OPENSSL=ON ..
- make
- make test
- cd ..
- mkdir build_shared && cd build_shared
- cmake -DENABLE_OPENSSL=ON -DBUILD_SHARED_LIBS=ON ..
- make
- make test
- cd ..
- meson setup --werror -Dcrypto-library=openssl builddir
- meson compile -C builddir
- meson test -v -C builddir
# linux build with openssl and clang
- os: linux
env:
- TEST="linux openssl (clang)"
addons:
apt:
packages:
- clang
install:
- pyenv global 3.7.1
- pip3 install meson ninja
script:
- CC=clang EXTRA_CFLAGS=-Werror ./configure --enable-openssl
- make
- make runtest
- CC=clang meson setup --werror -Dcrypto-library=openssl builddir
- meson compile -C builddir
- meson test -v -C builddir
# linux build with nss
- os: linux
env:
- TEST="linux nss (gcc / valgrind)"
addons:
apt:
sources:
- ubuntu-toolchain-r-test
packages:
- gcc-6
- valgrind
- libnss3-dev
install:
- pyenv global 3.7.1
- pip3 install meson ninja
script:
- CC=gcc-6 EXTRA_CFLAGS=-Werror ./configure --enable-nss
- make
- make runtest
- make runtest-valgrind
- CC=gcc-6 meson setup --werror -Dcrypto-library=nss builddir
- meson compile -C builddir
- meson test -v -C builddir
# default osx build
- os: osx
env:
- TEST="osx"
before_install:
- pip3 install meson ninja
script:
- EXTRA_CFLAGS=-Werror ./configure
- make
- make runtest
- make distclean
- mkdir build && cd build
- cmake ..
- make
- make test
- cd ..
- meson setup --werror builddir
- meson compile -C builddir
- meson test -v -C builddir
# osx build with openssl
- os: osx
osx_image: xcode11.2
env:
- TEST="osx openssl"
before_install:
- pip3 install meson ninja
- brew install [email protected]
script:
- PKG_CONFIG_PATH=$(brew --prefix [email protected])/lib/pkgconfig EXTRA_CFLAGS=-Werror ./configure --enable-openssl
- make
- make runtest
- make distclean
- mkdir build && cd build
- cmake -DOPENSSL_ROOT_DIR=$(brew --prefix [email protected]) -DENABLE_OPENSSL=ON ..
- make
- make test
- cd ..
- PKG_CONFIG_PATH=$(brew --prefix [email protected])/lib/pkgconfig meson setup --werror -Dcrypto-library=openssl builddir
- meson compile -C builddir
- meson test -v -C builddir
# osx build with nss
- os: osx
osx_image: xcode11.2
env:
- TEST="osx nss"
before_install:
- pip3 install meson ninja
script:
- PKG_CONFIG_PATH=$(brew --prefix nss)/lib/pkgconfig EXTRA_CFLAGS=-Werror ./configure --enable-nss
- make
- make runtest
- PKG_CONFIG_PATH=$(brew --prefix nss)/lib/pkgconfig meson setup --werror -Dcrypto-library=nss builddir
- meson compile -C builddir
- meson test -v -C builddir
# code format check
- os: linux
env:
- TEST="clang-format"
addons:
apt:
packages:
- clang-format-3.9
script:
- CLANG_FORMAT=clang-format-3.9 ./format.sh -d
# big-endian
- os: linux
env:
- TEST="big-endian"
services:
- docker
addons:
apt:
packages:
- qemu-user-static
- qemu-system-mips
before_install:
- sudo docker run --volume $(pwd):/src --workdir /src --name mipsX --tty --detach ubuntu:16.04 tail
- sudo docker exec --tty mipsX apt-get update
- sudo docker exec --tty mipsX apt-get install build-essential -y
- sudo docker exec --tty mipsX apt-get install qemu-user-static qemu-system-mips gcc-mips-linux-gnu python3-pip -y
- sudo docker exec --tty mipsX pip3 install meson ninja
script:
- sudo docker exec --tty mipsX bash -c 'EXTRA_CFLAGS=-static CC=mips-linux-gnu-gcc ./configure --host=mips-linux-gnu'
- sudo docker exec --tty mipsX make
- file test/srtp_driver
- make runtest
- |
cat > mips-cross-file.txt <<EOF
[host_machine]
system = 'linux'
cpu_family = 'mips'
cpu = 'mips'
endian = 'big'
[properties]
c_args = ['-static', '-static-libgcc']
c_link_args = ['-static', '-static-libgcc']
[binaries]
ar = 'mips-linux-gnu-gcc-ar'
c = 'mips-linux-gnu-gcc'
ranlib = 'mips-linux-gnu-gcc-ranlib'
exe_wrapper = 'qemu-mips-static'
pkgconfig = 'false'
EOF
- sudo docker exec --tty mipsX meson setup --cross-file mips-cross-file.txt -Ddefault_library=static -Db_staticpic=false builddir
- sudo docker exec --tty mipsX meson compile -C builddir
- sudo docker exec --tty mipsX meson test -v --timeout-multiplier 10 -C builddir
- sudo docker kill mipsX
# linux build of fuzzer
- os: linux
env:
- TEST="fuzzer (build only)"
addons:
apt:
packages:
- clang
script:
- CC=clang CXX=clang++ CXXFLAGS="-fsanitize=fuzzer-no-link,address,undefined -g -O3" CFLAGS="-fsanitize=fuzzer-no-link,address,undefined -g -O3" LDFLAGS="-fsanitize=fuzzer-no-link,address,undefined" ./configure
- LIBFUZZER="-fsanitize=fuzzer" make srtp-fuzzer
# coverity scan
- os: linux
env:
- TEST="Coverity Scan"
addons:
coverity_scan:
project:
name: "cisco-libSRTP"
description: "Build submitted via Travis CI"
version: 2
notification_email: [email protected]
build_command_prepend: "./configure"
build_command: "make"
branch_pattern: master
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-
# windows build
- os: windows
before_install:
- choco install python --version 3.8.0
- choco install ninja
- pip3 install meson
env:
- TEST="windows"
- PATH=/c/Python38:/c/Python38/Scripts:$PATH
script:
- export PATH="c:\Program Files (x86)\Microsoft Visual Studio\2017\BuildTools\MSBuild\15.0\Bin":$PATH
- mkdir build && cd build
- cmake -G "Visual Studio 15 2017" ..
- msbuild.exe libsrtp2.sln -p:Configuration=Release
- msbuild.exe RUN_TESTS.vcxproj -p:Configuration=Release
- cd ..
- mkdir build_shared && cd build_shared
- cmake -G "Visual Studio 15 2017" -DBUILD_SHARED_LIBS=ON ..
- msbuild.exe libsrtp2.sln -p:Configuration=Release
- msbuild.exe RUN_TESTS.vcxproj -p:Configuration=Release
# Test mingw build
- cd ..
- meson setup builddir-gcc
- meson compile -C builddir-gcc
- meson test -v -C builddir-gcc
# Test MSVC 64-bit build
- cmd.exe //C 'C:\Program Files (x86)\Microsoft Visual Studio\2017\BuildTools\VC\Auxiliary\Build\vcvarsall.bat' amd64 \& set CC=cl \& meson setup --werror builddir-msvc-amd64 \& meson compile -C builddir-msvc-amd64 \& meson test -v -C builddir-msvc-amd64
# Test MSVC 32-bit build
- cmd.exe //C 'C:\Program Files (x86)\Microsoft Visual Studio\2017\BuildTools\VC\Auxiliary\Build\vcvarsall.bat' x86 \& set CC=cl \& meson setup --werror builddir-msvc-x86 \& meson compile -C builddir-msvc-x86 \& meson test -v -C builddir-msvc-x86
# Test MSVC 64-bit UWP build. This is a cross build because we cannot run UWP binaries natively.
#- |
# cat > uwp-amd64-cross-file.txt <<EOF
# [host_machine]
# system = 'windows'
# cpu_family = 'x86_64'
# cpu = 'x86_64'
# endian = 'little'
#
# [properties]
# c_args = ['-DWINAPI_FAMILY=WINAPI_FAMILY_APP']
# c_link_args = ['-APPCONTAINER', 'WindowsApp.lib']
# needs_exe_wrapper = true
#
# [binaries]
# ar = 'lib'
# c = 'cl'
# cpp = 'cl'
# pkgconfig = 'false'
# EOF
#- cmd.exe //C 'C:\Program Files (x86)\Microsoft Visual Studio\2017\BuildTools\VC\Auxiliary\Build\vcvarsall.bat' amd64 uwp \& meson setup --werror --cross-file uwp-amd64-cross-file.txt builddir-uwp-amd64 \& meson compile -C builddir-uwp-amd64
# Test MSVC ARM64 UWP build. This is a cross build.
#- |
# cat > uwp-arm64-cross-file.txt <<EOF
# [host_machine]
# system = 'windows'
# cpu_family = 'aarch64'
# cpu = 'aarch64'
# endian = 'little'
#
# [properties]
# c_args = ['-DWINAPI_FAMILY=WINAPI_FAMILY_APP']
# c_link_args = ['-APPCONTAINER', 'WindowsApp.lib']
# needs_exe_wrapper = true
#
# [binaries]
# ar = 'lib'
# c = 'cl'
# cpp = 'cl'
# pkgconfig = 'false'
# EOF
#- cmd.exe //C 'C:\Program Files (x86)\Microsoft Visual Studio\2017\BuildTools\VC\Auxiliary\Build\vcvarsall.bat' amd64_arm64 uwp \& meson setup --werror --cross-file uwp-arm64-cross-file.txt builddir-uwp-arm64 \& meson compile -C builddir-uwp-arm64
# android build
- os: linux
env:
- TEST="android"
install:
- pyenv global 3.7.1
- pip3 install meson ninja
script:
- wget -q https://dl.google.com/android/repository/android-ndk-r20b-linux-x86_64.zip
- unzip -qq android-ndk-r20b-linux-x86_64.zip
- ANDROID_NDK=`pwd`/android-ndk-r20b
- mkdir build_android
- cd build_android
- cmake -DCMAKE_TOOLCHAIN_FILE=$ANDROID_NDK/build/cmake/android.toolchain.cmake -DANDROID_ABI=arm64-v8a ..
- make
- cd ..
- TOOLCHAIN=$ANDROID_NDK/toolchains/llvm/prebuilt/linux-x86_64
- AR=$TOOLCHAIN/bin/aarch64-linux-android-ar
AS=$TOOLCHAIN/bin/aarch64-linux-android-as
CC=$TOOLCHAIN/bin/aarch64-linux-android21-clang
CXX=$TOOLCHAIN/bin/aarch64-linux-android21-clang++
LD=$TOOLCHAIN/bin/aarch64-linux-android-ld
RANLIB=$TOOLCHAIN/bin/aarch64-linux-android-ranlib
STRIP=$TOOLCHAIN/bin/aarch64-linux-android-strip
./configure --host aarch64-linux-android
- make
- |
cat > android-cross-file.txt <<EOF
[host_machine]
system = 'android'
cpu_family = 'aarch64'
cpu = 'aarch64'
endian = 'little'
[properties]
sys_root = '$ANDROID_NDK/sysroot'
[binaries]
ar = '$TOOLCHAIN/bin/aarch64-linux-android-ar'
c = '$TOOLCHAIN/bin/aarch64-linux-android21-clang'
cpp = '$TOOLCHAIN/bin/aarch64-linux-android21-clang++'
ranlib = '$TOOLCHAIN/bin/aarch64-linux-android-ranlib'
strip = '$TOOLCHAIN/bin/aarch64-linux-android-strip'
pkgconfig = 'false'
EOF
- meson setup --werror --cross-file android-cross-file.txt builddir
- meson compile -C builddir
# ios build
- os: osx
osx_image: xcode11.2
env:
- TEST="ios"
before_install:
- pip3 install meson ninja
script:
- wget -q https://raw.githubusercontent.com/leetal/ios-cmake/master/ios.toolchain.cmake
- mkdir build && cd build
- cmake -DCMAKE_TOOLCHAIN_FILE=../ios.toolchain.cmake -DPLATFORM=OS64 ..
- make
- cd ..
- CFLAGS="-arch arm64 --sysroot=$(xcrun --sdk iphoneos --show-sdk-path) -miphoneos-version-min=8.0 -fembed-bitcode"
LDFLAGS="-arch arm64 --sysroot=$(xcrun --sdk iphoneos --show-sdk-path) -miphoneos-version-min=8.0 -fembed-bitcode"
AR="$(xcrun --find --sdk iphoneos ar)"
AS="$(xcrun --find --sdk iphoneos as)"
CC="$(xcrun --find --sdk iphoneos clang)"
CXX="$(xcrun --find --sdk iphoneos clang++)"
LD="$(xcrun --find --sdk iphoneos ld)"
RANLIB="$(xcrun --find --sdk iphoneos ranlib)"
STRIP="$(xcrun --find --sdk iphoneos strip)"
./configure --host arm-apple-darwin
- make
- make shared_library
- |
cat > ios-cross-file.txt <<EOF
[host_machine]
system = 'darwin'
cpu_family = 'aarch64'
cpu = 'aarch64'
endian = 'little'
[properties]
c_args = ['-arch', 'arm64', '--sysroot=$(xcrun --sdk iphoneos --show-sdk-path)', '-miphoneos-version-min=8.0']
c_link_args = ['-arch', 'arm64', '--sysroot=$(xcrun --sdk iphoneos --show-sdk-path)', '-miphoneos-version-min=8.0']
[binaries]
ar = '$(xcrun --find --sdk iphoneos ar)'
c = '$(xcrun --find --sdk iphoneos clang)'
cpp = '$(xcrun --find --sdk iphoneos clang++)'
ranlib = '$(xcrun --find --sdk iphoneos ranlib)'
strip = '$(xcrun --find --sdk iphoneos strip)'
pkgconfig = 'false'
EOF
- meson setup --werror -Db_bitcode=true --cross-file ios-cross-file.txt builddir
- meson compile -C builddir