.travis.yml 9.0 KB

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