.travis.yml 9.8 KB

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