.travis.yml 9.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375
  1. language: c
  2. sudo: required
  3. env:
  4. global:
  5. # GITAUTH:
  6. - secure: nSunY54Wp5HkQCHHbKwlwpbaKyqRVIu/0EnhaoJSwhM1wqerQV/E5d/2JelO9/tZgbungAO7wk/fjutRMVc7d378RTIPwS8vHpvZfEoGhCFsLoTOlqESzsZFBup2H5t1lpQ23jRHDOxlLdJy2lz5U+zd1YnYgDXqdDFjegsIYdo=
  7. - PYTHON=python2
  8. dist: trusty
  9. matrix:
  10. fast_finish: true
  11. include:
  12. #
  13. # gcc-4.8 (trusty) full host and cross build with tests:
  14. # doc, cert, cross-mingw32, cross-mingw64, cross-linux32, cross-raspi, linux64,
  15. # amalgamated, shared, multithread, encryption, discovery, json, test-ns0-full, test-ns0-minimal, debian-package
  16. - os: linux
  17. compiler: gcc-4.8
  18. addons:
  19. apt:
  20. sources:
  21. # see https://github.com/travis-ci/apt-source-whitelist/blob/master/ubuntu.json
  22. - ubuntu-toolchain-r-test
  23. packages:
  24. - mingw-w64
  25. - gcc-mingw-w64-i686
  26. - gcc-mingw-w64-x86-64
  27. - binutils-mingw-w64-i686
  28. - g++-multilib
  29. # debian packaging
  30. - cmake
  31. - debhelper
  32. - fakeroot
  33. # doc
  34. - python-sphinx
  35. - graphviz
  36. - texlive-generic-extra
  37. - texlive-fonts-recommended
  38. - texlive-latex-extra
  39. - latexmk
  40. # tests
  41. - check
  42. - valgrind
  43. env:
  44. - MINGW=true
  45. - DEBIAN=true
  46. #
  47. # gcc-8 full host build with tests:
  48. # doc, cert, linux64,
  49. # amalgamated, shared, multithread, encryption, discovery, json, test-ns0-full, test-ns0-minimal
  50. - os: linux
  51. compiler: gcc-8
  52. addons:
  53. apt:
  54. sources:
  55. - ubuntu-toolchain-r-test
  56. packages:
  57. - gcc-8
  58. - gcc-8-multilib
  59. # doc
  60. - python-sphinx
  61. - graphviz
  62. - texlive-generic-extra
  63. - texlive-fonts-recommended
  64. - texlive-latex-extra
  65. - latexmk
  66. # tests
  67. - check
  68. - valgrind
  69. #
  70. # clang-6 full host build with tests:
  71. # doc, cert, linux64,
  72. # amalgamated, shared, multithread, encryption, discovery, json, test-ns0-full, test-ns0-minimal
  73. - os: linux
  74. compiler: clang-6.0
  75. addons:
  76. apt:
  77. sources:
  78. - llvm-toolchain-trusty-6.0
  79. - ubuntu-toolchain-r-test
  80. packages:
  81. - clang-6.0
  82. - clang-tidy-6.0
  83. # doc
  84. - python-sphinx
  85. - graphviz
  86. - texlive-generic-extra
  87. - texlive-fonts-recommended
  88. - texlive-latex-extra
  89. - latexmk
  90. # tests
  91. - check
  92. - valgrind
  93. #
  94. # clang-6 python-3 full host build with tests:
  95. # doc, cert, linux64,
  96. # amalgamated, shared, multithread, encryption, discovery, json, test-ns0-full, test-ns0-minimal
  97. - os: linux
  98. compiler: clang-6.0
  99. addons:
  100. apt:
  101. sources:
  102. - llvm-toolchain-trusty-6.0
  103. - ubuntu-toolchain-r-test
  104. packages:
  105. - clang-6.0
  106. - clang-tidy-6.0
  107. # doc
  108. - python3-sphinx
  109. - graphviz
  110. - texlive-generic-extra
  111. - texlive-fonts-recommended
  112. - texlive-latex-extra
  113. - latexmk
  114. # tests
  115. - check
  116. - valgrind
  117. env:
  118. - PYTHON=python3
  119. #
  120. # tcc full host build:
  121. # doc, cert, linux64,
  122. # amalgamated, shared, multithread, encryption, discovery, json, test-ns0-full, test-ns0-minimal
  123. - os: linux
  124. compiler: tcc
  125. addons:
  126. apt:
  127. packages:
  128. # doc
  129. - python-sphinx
  130. - graphviz
  131. - texlive-generic-extra
  132. - texlive-fonts-recommended
  133. - texlive-latex-extra
  134. - latexmk
  135. # tests
  136. - check
  137. - valgrind
  138. #
  139. # clang-6 python-3 install build and minimal example:
  140. # linux64, minimal-example
  141. - os: linux
  142. compiler: clang-6.0
  143. addons:
  144. apt:
  145. sources:
  146. - llvm-toolchain-trusty-6.0
  147. - ubuntu-toolchain-r-test
  148. packages:
  149. - clang-6.0
  150. - clang-tidy-6.0
  151. env:
  152. - INSTALL=true
  153. - PYTHON=python3
  154. - CXX=clang-6.0
  155. #
  156. # gcc-4.8 static code analysis
  157. - os: linux
  158. compiler: gcc
  159. addons:
  160. apt:
  161. packages:
  162. - cppcheck
  163. env:
  164. - ANALYZE=true
  165. #
  166. # clang-6 static code analysis
  167. - os: linux
  168. compiler: clang-6.0
  169. addons:
  170. apt:
  171. sources:
  172. - llvm-toolchain-trusty-6.0
  173. - ubuntu-toolchain-r-test
  174. packages:
  175. - check
  176. - clang-6.0
  177. - clang-tidy-6.0
  178. env:
  179. - ANALYZE=true
  180. - PYTHON=python3
  181. #
  182. # clang-format code analysis
  183. # is allowed to fail (see allow_failures)
  184. - os: linux
  185. compiler: clang-6.0
  186. addons:
  187. apt:
  188. sources:
  189. - llvm-toolchain-trusty-6.0
  190. - ubuntu-toolchain-r-test
  191. packages:
  192. - clang-6.0
  193. - clang-tidy-6.0
  194. - clang-format-6.0
  195. env:
  196. - CLANG_FORMAT=true
  197. #
  198. # DOCKER build
  199. - os: linux
  200. compiler: gcc
  201. env:
  202. - DOCKER=true
  203. #
  204. # clang-6 FUZZER build
  205. - os: linux
  206. compiler: clang-6.0
  207. addons:
  208. apt:
  209. sources:
  210. - llvm-toolchain-trusty-6.0
  211. - ubuntu-toolchain-r-test
  212. packages:
  213. - check
  214. - clang-6.0
  215. - clang-tidy-6.0
  216. - libfuzzer-6.0-dev
  217. env:
  218. - FUZZER=true
  219. #
  220. # OSX clang build
  221. - os: osx
  222. compiler: clang
  223. # OSX may have different hostnames between processes, which causes multicast unit test to fail.
  224. # Hardcode the hostname here
  225. addons:
  226. hostname: travis-osx
  227. # disable homebrew auto update which takes a lot of time
  228. env: HOMEBREW_NO_AUTO_UPDATE=1
  229. cache:
  230. directories:
  231. - $HOME/Library/Caches/Homebrew
  232. #
  233. # SONAR gcc-4.9 build
  234. - os: linux
  235. compiler: gcc-4.9
  236. addons:
  237. sonarcloud:
  238. organization: open62541
  239. branches:
  240. - master
  241. - sonarcloud
  242. env:
  243. - SONAR=true
  244. cache:
  245. directories:
  246. - '$HOME/.sonar/cache'
  247. allow_failures:
  248. #
  249. # clang-format code analysis
  250. - env:
  251. - CLANG_FORMAT=true
  252. cache:
  253. pip: true
  254. apt: true
  255. directories:
  256. - $HOME/install
  257. - $HOME/.cache/pip
  258. # combine all the commands into one single command. See https://github.com/travis-ci/travis-ci/issues/1066
  259. before_install: |
  260. set -eE
  261. errorTrap() {
  262. last_rv=$?
  263. if [ $last_rv -ne 0 ] ; then
  264. echo ""
  265. echo ""
  266. echo "----------------- Error -----------------"
  267. echo ""
  268. echo "---- Check additional output above!! ----"
  269. # Wait a bit until the stdout is flushed
  270. for i in 1 2 3 4 5 6 7 8 9 10; do echo "."; sleep 1; done
  271. fi
  272. exit $last_rv
  273. }
  274. trap errorTrap 0
  275. # set paths for locally installed libs (like liburcu)
  276. export LOCAL_PKG=$HOME/install
  277. mkdir -p $LOCAL_PKG/lib
  278. mkdir -p $LOCAL_PKG/include
  279. mkdir -p $LOCAL_PKG/bin
  280. export LIBRARY_PATH=$LOCAL_PKG/lib:$LIBRARY_PATH
  281. export C_INCLUDE_PATH=$LOCAL_PKG/include:$C_INCLUDE_PATH
  282. export CPLUS_INCLUDE_PATH=$LOCAL_PKG/include:$CPLUS_INCLUDE_PATH
  283. export PKG_CONFIG_PATH=$LOCAL_PKG/lib/pkgconfig:$PKG_CONFIG_PATH
  284. export PATH=$LOCAL_PKG:$LOCAL_PKG/bin:$PATH
  285. export CMAKE_PREFIX_PATH=$LOCAL_PKG:CMAKE_PREFIX_PATH
  286. # set local path for python packages
  287. export PATH=$PATH:$HOME/.local/bin # linux
  288. export PATH=$PATH:$HOME/Library/Python #OS X
  289. export PATH=$PATH:$HOME/Library/Python/2.7/bin #OS X
  290. if [ ${TRAVIS_OS_NAME} == "linux" ]; then sh ./tools/travis/travis_linux_before_install.sh; fi
  291. if [ ${TRAVIS_OS_NAME} == "osx" ]; then sh ./tools/travis/travis_osx_before_install.sh; fi
  292. script: |
  293. set -eE
  294. errorTrap() {
  295. last_rv=$?
  296. if [ $last_rv -ne 0 ] ; then
  297. echo ""
  298. echo ""
  299. echo "----------------- Error -----------------"
  300. echo ""
  301. echo "---- Check additional output above!! ----"
  302. # Wait a bit until the stdout is flushed
  303. for i in 1 2 3 4 5 6 7 8 9 10; do echo "."; sleep 1; done
  304. fi
  305. exit $last_rv
  306. }
  307. trap errorTrap 0
  308. if [ ${TRAVIS_OS_NAME} == "linux" ]; then sh ./tools/travis/travis_linux_script.sh; fi
  309. if [ ${TRAVIS_OS_NAME} == "osx" ]; then sh ./tools/travis/travis_osx_script.sh; fi
  310. after_success: |
  311. set -eE
  312. errorTrap() {
  313. last_rv=$?
  314. if [ $last_rv -ne 0 ] ; then
  315. echo ""
  316. echo ""
  317. echo "----------------- Error -----------------"
  318. echo ""
  319. echo "---- Check additional output above!! ----"
  320. # Wait a bit until the stdout is flushed
  321. for i in 1 2 3 4 5 6 7 8 9 10; do echo "."; sleep 1; done
  322. fi
  323. exit $last_rv
  324. }
  325. trap errorTrap 0
  326. if [ ${TRAVIS_OS_NAME} == "linux" ]; then sh ./tools/travis/travis_linux_after_success.sh; fi
  327. # Sleep to flush travis output
  328. echo == Build success ==
  329. sleep 5
  330. after_failure: |
  331. # Sleep to flush travis output
  332. echo == Build failed ==
  333. sleep 5
  334. deploy:
  335. provider: releases
  336. api_key:
  337. secure: PKCoA7MBRtHloIbNF4Qj5LQyCafjekfVeFXlMBd9KmC0ynNuef+D7nn38f/jo25/b0Ii7r+hgslkQPezbKyEqo2zcCB8Pn8TWau2hbzKM/dUCPoN90HVaQcRjUi8P2Y+QkouwyPWSujBL35/X5QiAntRotCSbZx4fkyiN8cU95o=
  338. file:
  339. - open62541-win32.zip
  340. - open62541-win64.zip
  341. - open62541-linux32.tar.gz
  342. - open62541-linux64.tar.gz
  343. - open62541-raspberrypi.tar.gz
  344. - open62541.c
  345. - open62541.h
  346. - open62541*.deb
  347. file_glob: true
  348. skip_cleanup: true
  349. on:
  350. repo: open62541/open62541
  351. tags: true
  352. condition: $CC = gcc-4.8 && $ANALYZE = false