.travis.yml 8.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355
  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. # cpplint checking
  183. #- os: linux
  184. # compiler: gcc
  185. # env: LINT=true
  186. #
  187. # DOCKER build
  188. - os: linux
  189. compiler: gcc
  190. env:
  191. - DOCKER=true
  192. #
  193. # clang-6 FUZZER build
  194. - os: linux
  195. compiler: clang-6.0
  196. addons:
  197. apt:
  198. sources:
  199. - llvm-toolchain-trusty-6.0
  200. - ubuntu-toolchain-r-test
  201. packages:
  202. - check
  203. - clang-6.0
  204. - clang-tidy-6.0
  205. - libfuzzer-6.0-dev
  206. env:
  207. - FUZZER=true
  208. #
  209. # OSX clang build
  210. - os: osx
  211. compiler: clang
  212. # disable homebrew auto update which takes a lot of time
  213. env: HOMEBREW_NO_AUTO_UPDATE=1
  214. cache:
  215. directories:
  216. - $HOME/Library/Caches/Homebrew
  217. #
  218. # SONAR gcc-4.9 build
  219. - os: linux
  220. compiler: gcc-4.9
  221. addons:
  222. sonarcloud:
  223. organization: open62541
  224. branches:
  225. - master
  226. - sonarcloud
  227. env:
  228. - SONAR=true
  229. cache:
  230. directories:
  231. - '$HOME/.sonar/cache'
  232. cache:
  233. pip: true
  234. apt: true
  235. directories:
  236. - $HOME/install
  237. - $HOME/.cache/pip
  238. # combine all the commands into one single command. See https://github.com/travis-ci/travis-ci/issues/1066
  239. before_install: |
  240. set -eE
  241. errorTrap() {
  242. last_rv=$?
  243. if [ $last_rv -ne 0 ] ; then
  244. echo ""
  245. echo ""
  246. echo "----------------- Error -----------------"
  247. echo ""
  248. echo "---- Check additional output above!! ----"
  249. # Wait a bit until the stdout is flushed
  250. for i in 1 2 3 4 5 6 7 8 9 10; do echo "."; sleep 1; done
  251. fi
  252. exit $last_rv
  253. }
  254. trap errorTrap 0
  255. # set paths for locally installed libs (like liburcu)
  256. export LOCAL_PKG=$HOME/install
  257. mkdir -p $LOCAL_PKG/lib
  258. mkdir -p $LOCAL_PKG/include
  259. mkdir -p $LOCAL_PKG/bin
  260. export LIBRARY_PATH=$LOCAL_PKG/lib:$LIBRARY_PATH
  261. export C_INCLUDE_PATH=$LOCAL_PKG/include:$C_INCLUDE_PATH
  262. export CPLUS_INCLUDE_PATH=$LOCAL_PKG/include:$CPLUS_INCLUDE_PATH
  263. export PKG_CONFIG_PATH=$LOCAL_PKG/lib/pkgconfig:$PKG_CONFIG_PATH
  264. export PATH=$LOCAL_PKG:$LOCAL_PKG/bin:$PATH
  265. export CMAKE_PREFIX_PATH=$LOCAL_PKG:CMAKE_PREFIX_PATH
  266. # set local path for python packages
  267. export PATH=$PATH:$HOME/.local/bin # linux
  268. export PATH=$PATH:$HOME/Library/Python #OS X
  269. export PATH=$PATH:$HOME/Library/Python/2.7/bin #OS X
  270. if [ ${TRAVIS_OS_NAME} == "linux" ]; then sh ./tools/travis/travis_linux_before_install.sh; fi
  271. if [ ${TRAVIS_OS_NAME} == "osx" ]; then sh ./tools/travis/travis_osx_before_install.sh; fi
  272. script: |
  273. set -eE
  274. errorTrap() {
  275. last_rv=$?
  276. if [ $last_rv -ne 0 ] ; then
  277. echo ""
  278. echo ""
  279. echo "----------------- Error -----------------"
  280. echo ""
  281. echo "---- Check additional output above!! ----"
  282. # Wait a bit until the stdout is flushed
  283. for i in 1 2 3 4 5 6 7 8 9 10; do echo "."; sleep 1; done
  284. fi
  285. exit $last_rv
  286. }
  287. trap errorTrap 0
  288. if [ ${TRAVIS_OS_NAME} == "linux" ]; then sh ./tools/travis/travis_linux_script.sh; fi
  289. if [ ${TRAVIS_OS_NAME} == "osx" ]; then sh ./tools/travis/travis_osx_script.sh; fi
  290. after_success: |
  291. set -eE
  292. errorTrap() {
  293. last_rv=$?
  294. if [ $last_rv -ne 0 ] ; then
  295. echo ""
  296. echo ""
  297. echo "----------------- Error -----------------"
  298. echo ""
  299. echo "---- Check additional output above!! ----"
  300. # Wait a bit until the stdout is flushed
  301. for i in 1 2 3 4 5 6 7 8 9 10; do echo "."; sleep 1; done
  302. fi
  303. exit $last_rv
  304. }
  305. trap errorTrap 0
  306. if [ ${TRAVIS_OS_NAME} == "linux" ]; then sh ./tools/travis/travis_linux_after_success.sh; fi
  307. # Sleep to flush travis output
  308. echo == Build success ==
  309. sleep 5
  310. after_failure: |
  311. # Sleep to flush travis output
  312. echo == Build failed ==
  313. sleep 5
  314. deploy:
  315. provider: releases
  316. api_key:
  317. secure: PKCoA7MBRtHloIbNF4Qj5LQyCafjekfVeFXlMBd9KmC0ynNuef+D7nn38f/jo25/b0Ii7r+hgslkQPezbKyEqo2zcCB8Pn8TWau2hbzKM/dUCPoN90HVaQcRjUi8P2Y+QkouwyPWSujBL35/X5QiAntRotCSbZx4fkyiN8cU95o=
  318. file:
  319. - open62541-win32.zip
  320. - open62541-win64.zip
  321. - open62541-linux32.tar.gz
  322. - open62541-linux64.tar.gz
  323. - open62541-raspberrypi.tar.gz
  324. - open62541.c
  325. - open62541.h
  326. - open62541*.deb
  327. file_glob: true
  328. skip_cleanup: true
  329. on:
  330. repo: open62541/open62541
  331. tags: true
  332. condition: $CC = gcc-4.8 && $ANALYZE = false