.travis.yml 7.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259
  1. dist: xenial
  2. sudo: false
  3. language: c
  4. env:
  5. global:
  6. - secure: "QD09MuUxftXRXtz7ZrB7S0NV/3O9yVhjvIlCSbXN8B87rNSDC8wxMThKMT7iZewnqGk53m+Up19PiMw5ERlHose5tm2cmY1FO/l+c9oAyWZaAL+4XNXryq6zI5F5FX5I61NbfqV3xcnfLTI2QIJF6WqDojNxhPjTbNzQGxIDuqw="
  7. matrix:
  8. include:
  9. # linux build
  10. - os: linux
  11. env:
  12. - TEST="linux (gcc / valgrind)"
  13. addons:
  14. apt:
  15. sources:
  16. - ubuntu-toolchain-r-test
  17. packages:
  18. - gcc-6
  19. - valgrind
  20. script:
  21. - CC=gcc-6 EXTRA_CFLAGS=-Werror ./configure
  22. - make
  23. - make runtest
  24. - make runtest-valgrind
  25. - make distclean
  26. - mkdir build && cd build
  27. - cmake ..
  28. - make
  29. - make test
  30. # linux build with openssl
  31. - os: linux
  32. env:
  33. - TEST="linux openssl (gcc / valgrind)"
  34. addons:
  35. apt:
  36. sources:
  37. - ubuntu-toolchain-r-test
  38. packages:
  39. - gcc-6
  40. - valgrind
  41. script:
  42. - CC=gcc-6 EXTRA_CFLAGS=-Werror ./configure --enable-openssl
  43. - make
  44. - make runtest
  45. - make runtest-valgrind
  46. - make distclean
  47. - mkdir build && cd build
  48. - cmake -DENABLE_OPENSSL=ON ..
  49. - make
  50. - make test
  51. - cd ..
  52. - mkdir build_shared && cd build_shared
  53. - cmake -DENABLE_OPENSSL=ON -DBUILD_SHARED_LIBS=ON ..
  54. - make
  55. - make test
  56. # linux build with openssl and clang
  57. - os: linux
  58. env:
  59. - TEST="linux openssl (clang)"
  60. addons:
  61. apt:
  62. packages:
  63. - clang
  64. script:
  65. - CC=clang EXTRA_CFLAGS=-Werror ./configure --enable-openssl
  66. - make
  67. - make runtest
  68. # linux build with nss
  69. - os: linux
  70. env:
  71. - TEST="linux nss (gcc / valgrind)"
  72. addons:
  73. apt:
  74. sources:
  75. - ubuntu-toolchain-r-test
  76. packages:
  77. - gcc-6
  78. - valgrind
  79. - libnss3-dev
  80. script:
  81. - CC=gcc-6 EXTRA_CFLAGS=-Werror ./configure --enable-nss
  82. - make
  83. - make runtest
  84. - make runtest-valgrind
  85. # default osx build
  86. - os: osx
  87. env:
  88. - TEST="osx"
  89. script:
  90. - EXTRA_CFLAGS=-Werror ./configure
  91. - make
  92. - make runtest
  93. - make distclean
  94. - mkdir build && cd build
  95. - cmake ..
  96. - make
  97. - make test
  98. # osx build with openssl
  99. - os: osx
  100. osx_image: xcode11.2
  101. env:
  102. - TEST="osx openssl"
  103. before_install:
  104. - brew install openssl@1.1
  105. script:
  106. - PKG_CONFIG_PATH=$(brew --prefix openssl@1.1)/lib/pkgconfig EXTRA_CFLAGS=-Werror ./configure --enable-openssl
  107. - make
  108. - make runtest
  109. - make distclean
  110. - mkdir build && cd build
  111. - cmake -DOPENSSL_ROOT_DIR=$(brew --prefix openssl@1.1) -DENABLE_OPENSSL=ON ..
  112. - make
  113. - make test
  114. # osx build with nss
  115. - os: osx
  116. osx_image: xcode11.2
  117. env:
  118. - TEST="osx nss"
  119. script:
  120. - PKG_CONFIG_PATH=$(brew --prefix nss)/lib/pkgconfig EXTRA_CFLAGS=-Werror ./configure --enable-nss
  121. - make
  122. - make runtest
  123. # code format check
  124. - os: linux
  125. env:
  126. - TEST="clang-format"
  127. addons:
  128. apt:
  129. packages:
  130. - clang-format-3.9
  131. script:
  132. - CLANG_FORMAT=clang-format-3.9 ./format.sh -d
  133. # big-endian
  134. - os: linux
  135. sudo: true
  136. env:
  137. - TEST="big-endian"
  138. services:
  139. - docker
  140. addons:
  141. apt:
  142. packages:
  143. - qemu-user-static
  144. - qemu-system-mips
  145. before_install:
  146. - sudo docker run --volume $(pwd):/src --workdir /src --name mipsX --tty --detach ubuntu:16.04 tail
  147. - sudo docker exec --tty mipsX apt-get update
  148. - sudo docker exec --tty mipsX apt-get install build-essential -y
  149. - sudo docker exec --tty mipsX apt-get install gcc-mips-linux-gnu -y
  150. script:
  151. - sudo docker exec --tty mipsX bash -c 'EXTRA_CFLAGS=-static CC=mips-linux-gnu-gcc ./configure --host=mips-linux-gnu'
  152. - sudo docker exec --tty mipsX make
  153. - sudo docker kill mipsX
  154. - file test/srtp_driver
  155. - make runtest
  156. # linux build of fuzzer
  157. - os: linux
  158. env:
  159. - TEST="fuzzer (build only)"
  160. addons:
  161. apt:
  162. packages:
  163. - clang
  164. script:
  165. - 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
  166. - LIBFUZZER="-fsanitize=fuzzer" make srtp-fuzzer
  167. # coverity scan
  168. - os: linux
  169. env:
  170. - TEST="Coverity Scan"
  171. addons:
  172. coverity_scan:
  173. project:
  174. name: "cisco-libSRTP"
  175. description: "Build submitted via Travis CI"
  176. version: 2
  177. notification_email: pabuhler@cisco.com
  178. build_command_prepend: "./configure"
  179. build_command: "make"
  180. branch_pattern: master
  181. script:
  182. - echo -n | openssl s_client -connect scan.coverity.com:443 | sed -ne '/-BEGIN CERTIFICATE-/,/-END CERTIFICATE-/p' | sudo tee -a /etc/ssl/certs/ca-
  183. # windows build
  184. - os: windows
  185. env:
  186. - TEST="windows"
  187. script:
  188. - export PATH="c:\Program Files (x86)\Microsoft Visual Studio\2017\BuildTools\MSBuild\15.0\Bin":$PATH
  189. - mkdir build && cd build
  190. - cmake -G "Visual Studio 15 2017" ..
  191. - msbuild.exe libsrtp2.sln -p:Configuration=Release
  192. - msbuild.exe RUN_TESTS.vcxproj -p:Configuration=Release
  193. - cd ..
  194. - mkdir build_shared && cd build_shared
  195. - cmake -G "Visual Studio 15 2017" -DBUILD_SHARED_LIBS=ON ..
  196. - msbuild.exe libsrtp2.sln -p:Configuration=Release
  197. - msbuild.exe RUN_TESTS.vcxproj -p:Configuration=Release
  198. # android build
  199. - os: linux
  200. env:
  201. - TEST="android"
  202. script:
  203. - wget -q https://dl.google.com/android/repository/android-ndk-r20b-linux-x86_64.zip
  204. - unzip -qq android-ndk-r20b-linux-x86_64.zip
  205. - ANDROID_NDK=`pwd`/android-ndk-r20b
  206. - mkdir build_android
  207. - cd build_android
  208. - cmake -DCMAKE_TOOLCHAIN_FILE=$ANDROID_NDK/build/cmake/android.toolchain.cmake -DANDROID_ABI=arm64-v8a ..
  209. - make
  210. - cd ..
  211. - TOOLCHAIN=$ANDROID_NDK/toolchains/llvm/prebuilt/linux-x86_64
  212. AR=$TOOLCHAIN/bin/aarch64-linux-android-ar
  213. AS=$TOOLCHAIN/bin/aarch64-linux-android-as
  214. CC=$TOOLCHAIN/bin/aarch64-linux-android21-clang
  215. CXX=$TOOLCHAIN/bin/aarch64-linux-android21-clang++
  216. LD=$TOOLCHAIN/bin/aarch64-linux-android-ld
  217. RANLIB=$TOOLCHAIN/bin/aarch64-linux-android-ranlib
  218. STRIP=$TOOLCHAIN/bin/aarch64-linux-android-strip
  219. ./configure --host aarch64-linux-android
  220. - make
  221. # ios build with openssl
  222. - os: osx
  223. osx_image: xcode11.2
  224. env:
  225. - TEST="ios"
  226. script:
  227. - wget -q https://raw.githubusercontent.com/leetal/ios-cmake/master/ios.toolchain.cmake
  228. - mkdir build && cd build
  229. - cmake -DCMAKE_TOOLCHAIN_FILE=../ios.toolchain.cmake -DPLATFORM=OS64 ..
  230. - make
  231. - cd ..
  232. - CFLAGS="-arch arm64 --sysroot=$(xcrun --sdk iphoneos --show-sdk-path) -miphoneos-version-min=8.0 -fembed-bitcode"
  233. LDFLAGS="-arch arm64 --sysroot=$(xcrun --sdk iphoneos --show-sdk-path) -miphoneos-version-min=8.0 -fembed-bitcode"
  234. AR="$(xcrun --find --sdk iphoneos ar)"
  235. AS="$(xcrun --find --sdk iphoneos as)"
  236. CC="$(xcrun --find --sdk iphoneos clang)"
  237. CXX="$(xcrun --find --sdk iphoneos clang++)"
  238. LD="$(xcrun --find --sdk iphoneos ld)"
  239. RANLIB="$(xcrun --find --sdk iphoneos ranlib)"
  240. STRIP="$(xcrun --find --sdk iphoneos strip)"
  241. ./configure --host arm-apple-darwin
  242. - make
  243. - make shared_library