.travis.yml 9.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371
  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. # disable homebrew auto update which takes a lot of time
  224. env: HOMEBREW_NO_AUTO_UPDATE=1
  225. cache:
  226. directories:
  227. - $HOME/Library/Caches/Homebrew
  228. #
  229. # SONAR gcc-4.9 build
  230. - os: linux
  231. compiler: gcc-4.9
  232. addons:
  233. sonarcloud:
  234. organization: open62541
  235. branches:
  236. - master
  237. - sonarcloud
  238. env:
  239. - SONAR=true
  240. cache:
  241. directories:
  242. - '$HOME/.sonar/cache'
  243. allow_failures:
  244. #
  245. # clang-format code analysis
  246. - env:
  247. - CLANG_FORMAT=true
  248. cache:
  249. pip: true
  250. apt: true
  251. directories:
  252. - $HOME/install
  253. - $HOME/.cache/pip
  254. # combine all the commands into one single command. See https://github.com/travis-ci/travis-ci/issues/1066
  255. before_install: |
  256. set -eE
  257. errorTrap() {
  258. last_rv=$?
  259. if [ $last_rv -ne 0 ] ; then
  260. echo ""
  261. echo ""
  262. echo "----------------- Error -----------------"
  263. echo ""
  264. echo "---- Check additional output above!! ----"
  265. # Wait a bit until the stdout is flushed
  266. for i in 1 2 3 4 5 6 7 8 9 10; do echo "."; sleep 1; done
  267. fi
  268. exit $last_rv
  269. }
  270. trap errorTrap 0
  271. # set paths for locally installed libs (like liburcu)
  272. export LOCAL_PKG=$HOME/install
  273. mkdir -p $LOCAL_PKG/lib
  274. mkdir -p $LOCAL_PKG/include
  275. mkdir -p $LOCAL_PKG/bin
  276. export LIBRARY_PATH=$LOCAL_PKG/lib:$LIBRARY_PATH
  277. export C_INCLUDE_PATH=$LOCAL_PKG/include:$C_INCLUDE_PATH
  278. export CPLUS_INCLUDE_PATH=$LOCAL_PKG/include:$CPLUS_INCLUDE_PATH
  279. export PKG_CONFIG_PATH=$LOCAL_PKG/lib/pkgconfig:$PKG_CONFIG_PATH
  280. export PATH=$LOCAL_PKG:$LOCAL_PKG/bin:$PATH
  281. export CMAKE_PREFIX_PATH=$LOCAL_PKG:CMAKE_PREFIX_PATH
  282. # set local path for python packages
  283. export PATH=$PATH:$HOME/.local/bin # linux
  284. export PATH=$PATH:$HOME/Library/Python #OS X
  285. export PATH=$PATH:$HOME/Library/Python/2.7/bin #OS X
  286. if [ ${TRAVIS_OS_NAME} == "linux" ]; then sh ./tools/travis/travis_linux_before_install.sh; fi
  287. if [ ${TRAVIS_OS_NAME} == "osx" ]; then sh ./tools/travis/travis_osx_before_install.sh; fi
  288. script: |
  289. set -eE
  290. errorTrap() {
  291. last_rv=$?
  292. if [ $last_rv -ne 0 ] ; then
  293. echo ""
  294. echo ""
  295. echo "----------------- Error -----------------"
  296. echo ""
  297. echo "---- Check additional output above!! ----"
  298. # Wait a bit until the stdout is flushed
  299. for i in 1 2 3 4 5 6 7 8 9 10; do echo "."; sleep 1; done
  300. fi
  301. exit $last_rv
  302. }
  303. trap errorTrap 0
  304. if [ ${TRAVIS_OS_NAME} == "linux" ]; then sh ./tools/travis/travis_linux_script.sh; fi
  305. if [ ${TRAVIS_OS_NAME} == "osx" ]; then sh ./tools/travis/travis_osx_script.sh; fi
  306. after_success: |
  307. set -eE
  308. errorTrap() {
  309. last_rv=$?
  310. if [ $last_rv -ne 0 ] ; then
  311. echo ""
  312. echo ""
  313. echo "----------------- Error -----------------"
  314. echo ""
  315. echo "---- Check additional output above!! ----"
  316. # Wait a bit until the stdout is flushed
  317. for i in 1 2 3 4 5 6 7 8 9 10; do echo "."; sleep 1; done
  318. fi
  319. exit $last_rv
  320. }
  321. trap errorTrap 0
  322. if [ ${TRAVIS_OS_NAME} == "linux" ]; then sh ./tools/travis/travis_linux_after_success.sh; fi
  323. # Sleep to flush travis output
  324. echo == Build success ==
  325. sleep 5
  326. after_failure: |
  327. # Sleep to flush travis output
  328. echo == Build failed ==
  329. sleep 5
  330. deploy:
  331. provider: releases
  332. api_key:
  333. secure: PKCoA7MBRtHloIbNF4Qj5LQyCafjekfVeFXlMBd9KmC0ynNuef+D7nn38f/jo25/b0Ii7r+hgslkQPezbKyEqo2zcCB8Pn8TWau2hbzKM/dUCPoN90HVaQcRjUi8P2Y+QkouwyPWSujBL35/X5QiAntRotCSbZx4fkyiN8cU95o=
  334. file:
  335. - open62541-win32.zip
  336. - open62541-win64.zip
  337. - open62541-linux32.tar.gz
  338. - open62541-linux64.tar.gz
  339. - open62541-raspberrypi.tar.gz
  340. - open62541.c
  341. - open62541.h
  342. - open62541*.deb
  343. file_glob: true
  344. skip_cleanup: true
  345. on:
  346. repo: open62541/open62541
  347. tags: true
  348. condition: $CC = gcc-4.8 && $ANALYZE = false