.travis.yml 9.4 KB

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