.travis.yml 9.7 KB

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