.travis.yml 9.6 KB

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