.travis.yml 6.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133
  1. language: c
  2. compiler:
  3. - gcc
  4. - clang
  5. env:
  6. global:
  7. - secure: nSunY54Wp5HkQCHHbKwlwpbaKyqRVIu/0EnhaoJSwhM1wqerQV/E5d/2JelO9/tZgbungAO7wk/fjutRMVc7d378RTIPwS8vHpvZfEoGhCFsLoTOlqESzsZFBup2H5t1lpQ23jRHDOxlLdJy2lz5U+zd1YnYgDXqdDFjegsIYdo=
  8. - secure: ehswgymGXPM3UINhOOnfSByMnrRNTixeT2vEV+z3kXy3WHew/O1yt9GxaYGrUhJPg4+5chAQgjYmezO1x3/CUKFgeHQUmVTFWEzfy1kL1JVjO+ufYyJDnbY+x3OmyNmMYcef2J5MAuUS2C1KFvIxtLsljVK+gpe4LcylkCIF/3Y=
  9. addons:
  10. coverity_scan:
  11. project:
  12. name: acplt/open62541
  13. description: Open-source OPC UA
  14. notification_email: null@plt.rwth-aachen.de
  15. build_command_prepend: mkdir build && cd build && cmake ..
  16. build_command: make
  17. branch_pattern: coverity_scan
  18. before_install:
  19. - sudo apt-get install binutils-mingw-w64-i686 gcc-mingw-w64-i686 mingw-w64
  20. - sudo add-apt-repository ppa:kalakris/cmake -y
  21. - sudo apt-get update -qq
  22. - sudo apt-get install -qq --no-install-recommends build-essential cmake python-lxml gcc-multilib graphviz doxygen wget zip
  23. - sudo apt-get install libsubunit-dev #for check_0.10.0
  24. - wget http://ftp.de.debian.org/debian/pool/main/c/check/check_0.10.0-2_amd64.deb
  25. - sudo dpkg -i check_0.10.0-2_amd64.deb
  26. - wget https://launchpad.net/ubuntu/+source/liburcu/0.8.5-1ubuntu1/+build/6513813/+files/liburcu2_0.8.5-1ubuntu1_amd64.deb
  27. - wget https://launchpad.net/ubuntu/+source/liburcu/0.8.5-1ubuntu1/+build/6513813/+files/liburcu-dev_0.8.5-1ubuntu1_amd64.deb
  28. - sudo dpkg -i liburcu2_0.8.5-1ubuntu1_amd64.deb
  29. - sudo dpkg -i liburcu-dev_0.8.5-1ubuntu1_amd64.deb
  30. - sudo pip install cpp-coveralls
  31. - sudo pip install sphinx
  32. - sudo pip install breathe
  33. - sudo pip install sphinx_rtd_theme
  34. script:
  35. - echo "Checking the applicability of patches"
  36. - # ./tools/.checkPorts.sh
  37. - echo "Documentation and certificate build"
  38. - mkdir -p build
  39. - cd build
  40. - cmake -DCMAKE_BUILD_TYPE=Release -DBUILD_DOCUMENTATION=ON -DGENERATE_SELFSIGNED=ON ..
  41. - make doc
  42. - make selfsigned
  43. - cp -r doc ..
  44. - cp server_cert.der ..
  45. - echo "Testing builds"
  46. - cd .. && rm build -rf && mkdir -p build && cd build
  47. - echo "Cross compile release build for MinGW 32 bit"
  48. - cmake -DCMAKE_TOOLCHAIN_FILE=../cmake/Toolchain-mingw32.cmake -DENABLE_AMALGAMATION=ON -DCMAKE_BUILD_TYPE=Release -DBUILD_EXAMPLESERVER=ON -DBUILD_EXAMPLECLIENT=ON ..
  49. - make
  50. - cp ../README.md .
  51. - cp ../LICENSE .
  52. - cp ../AUTHORS .
  53. - cp -r ../doc .
  54. - cp ../server_cert.der .
  55. - zip -r open62541-win32.zip doc server_cert.der LICENSE AUTHORS README.md server_static.exe server.exe client.exe client_static.exe libopen62541.dll libopen62541.dll.a open62541.h open62541.c
  56. - cp open62541-win32.zip ..
  57. - cd .. && rm build -rf && mkdir -p build && cd build
  58. - echo "Cross compile release build for MinGW 64 bit"
  59. - cmake -DCMAKE_TOOLCHAIN_FILE=../cmake/Toolchain-mingw64.cmake -DENABLE_AMALGAMATION=ON -DCMAKE_BUILD_TYPE=Release -DBUILD_EXAMPLESERVER=ON -DBUILD_EXAMPLECLIENT=ON ..
  60. - make
  61. - cp ../README.md .
  62. - cp ../LICENSE .
  63. - cp ../AUTHORS .
  64. - cp -r ../doc .
  65. - cp ../server_cert.der .
  66. - zip -r open62541-win64.zip doc server_cert.der LICENSE AUTHORS README.md server_static.exe server.exe client.exe client_static.exe libopen62541.dll libopen62541.dll.a open62541.h open62541.c
  67. - cp open62541-win64.zip ..
  68. - cd .. && rm build -rf && mkdir -p build && cd build
  69. - echo "Cross compile release build for 32-bit linux"
  70. - cmake -DCMAKE_TOOLCHAIN_FILE=../cmake/Toolchain-gcc-m32.cmake -DENABLE_AMALGAMATION=ON -DCMAKE_BUILD_TYPE=Release -DBUILD_EXAMPLESERVER=ON -DBUILD_EXAMPLECLIENT=ON ..
  71. - make
  72. - tar -pczf open62541-linux32.tar.gz ../doc ../server_cert.der ../LICENSE ../AUTHORS ../README.md server_static server client_static client libopen62541.so open62541.h open62541.c
  73. - cp open62541-linux32.tar.gz ..
  74. - cd .. && rm build -rf && mkdir -p build && cd build
  75. - echo "Compile release build for 64-bit linux"
  76. - cmake -DCMAKE_BUILD_TYPE=Release -DENABLE_AMALGAMATION=ON -DBUILD_EXAMPLESERVER=ON -DBUILD_EXAMPLECLIENT=ON ..
  77. - make
  78. - tar -pczf open62541-linux64.tar.gz ../doc ../server_cert.der ../LICENSE ../AUTHORS ../README.md server_static server client_static client libopen62541.so open62541.h open62541.c
  79. - cp open62541-linux64.tar.gz ..
  80. - cp open62541.h .. #copy single file-release
  81. - cp open62541.c .. #copy single file-release
  82. - cd .. && rm build -rf && mkdir -p build && cd build
  83. - echo "Upgrade to gcc 4.8"
  84. - sudo add-apt-repository ppa:ubuntu-toolchain-r/test -y
  85. - sudo apt-get update -qq
  86. - sudo apt-get install -qq gcc-4.8 valgrind
  87. - sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-4.8 20
  88. - sudo update-alternatives --config gcc
  89. - echo "Compile multithreaded version"
  90. - cmake -DENABLE_MULTITHREADING=ON -DBUILD_EXAMPLESERVER=ON ..
  91. - make
  92. - cd .. && rm build -rf && mkdir -p build && cd build
  93. - echo "Debug build and unit tests (64 bit)"
  94. - cmake -DCMAKE_BUILD_TYPE=Debug -DBUILD_DEMO_NODESET=ON -DBUILD_UNIT_TESTS=ON -DBUILD_EXAMPLESERVER=ON -DENABLE_COVERAGE=ON ..
  95. - make && make test
  96. - echo "Run valgrind to see if the server leaks memory (just starting up and closing..)"
  97. - if [[ ! ( ${TRAVIS_OS_NAME} == "linux" && ${CC} == "clang") ]]; then
  98. (valgrind --error-exitcode=3 ./server & export pid=$!; sleep 2; kill -INT $pid; wait $pid);
  99. (coveralls --gcov /usr/bin/gcov-4.8 -E '.*\.h' -E '.*CMakeCXXCompilerId\.cpp' -E '.*CMakeCCompilerId\.c' -r ../ ; exit 0);
  100. fi
  101. - cd ..
  102. after_success:
  103. - if [[ ( ${TRAVIS_OS_NAME} == "linux" && ${CC} == "gcc") ]]; then ./tools/.deployGH.sh; fi
  104. - if [[ ( ${TRAVIS_OS_NAME} == "linux" && ${CC} == "gcc") ]]; then ./tools/.coverity.sh; fi
  105. before_deploy:
  106. - rm build -rf && mkdir -p build && cd build
  107. - echo "Cross compile release build for Raspberry Pi"
  108. - cd ~
  109. - git clone https://github.com/raspberrypi/tools
  110. - cd -
  111. - export PATH=$PATH:~/tools/arm-bcm2708/gcc-linaro-arm-linux-gnueabihf-raspbian-x64/bin/
  112. - cmake -DCMAKE_TOOLCHAIN_FILE=../cmake/Toolchain-rpi64.cmake -DENABLE_AMALGAMATION=ON -DCMAKE_BUILD_TYPE=Release -DBUILD_EXAMPLESERVER=ON -DBUILD_EXAMPLECLIENT=ON ..
  113. - make
  114. - tar -pczf open62541-raspberrypi.tar.gz ../doc ../server_cert.der ../LICENSE ../AUTHORS ../README.md server_static server client_static client libopen62541.so open62541.h open62541.c
  115. - cp open62541-raspberrypi.tar.gz ..
  116. - cd ..
  117. deploy:
  118. provider: releases
  119. api_key:
  120. secure: PKCoA7MBRtHloIbNF4Qj5LQyCafjekfVeFXlMBd9KmC0ynNuef+D7nn38f/jo25/b0Ii7r+hgslkQPezbKyEqo2zcCB8Pn8TWau2hbzKM/dUCPoN90HVaQcRjUi8P2Y+QkouwyPWSujBL35/X5QiAntRotCSbZx4fkyiN8cU95o=
  121. file:
  122. - open62541-win32.zip
  123. - open62541-win64.zip
  124. - open62541-linux32.tar.gz
  125. - open62541-linux64.tar.gz
  126. - open62541-raspberrypi.tar.gz
  127. - open62541.c
  128. - open62541.h
  129. skip_cleanup: true
  130. on:
  131. tags: true
  132. condition: $CC = gcc