language: c
compiler:
- gcc
env:
  global:
   #this is the encrypted GITAUTH
   - secure: "nSunY54Wp5HkQCHHbKwlwpbaKyqRVIu/0EnhaoJSwhM1wqerQV/E5d/2JelO9/tZgbungAO7wk/fjutRMVc7d378RTIPwS8vHpvZfEoGhCFsLoTOlqESzsZFBup2H5t1lpQ23jRHDOxlLdJy2lz5U+zd1YnYgDXqdDFjegsIYdo="
   # The next declaration is the encrypted COVERITY_SCAN_TOKEN, created
   - secure: "ehswgymGXPM3UINhOOnfSByMnrRNTixeT2vEV+z3kXy3WHew/O1yt9GxaYGrUhJPg4+5chAQgjYmezO1x3/CUKFgeHQUmVTFWEzfy1kL1JVjO+ufYyJDnbY+x3OmyNmMYcef2J5MAuUS2C1KFvIxtLsljVK+gpe4LcylkCIF/3Y="
addons:
  coverity_scan:
    project:
      name: acplt/open62541
      description: Open-source OPC UA
    notification_email: null@plt.rwth-aachen.de
    build_command_prepend: mkdir build && cd build && cmake ..
    build_command: make
    branch_pattern: coverity_scan
before_install:
   - sudo add-apt-repository ppa:ubuntu-toolchain-r/test -y
   - sudo add-apt-repository ppa:kalakris/cmake -y
   - sudo apt-get update -qq
   - sudo apt-get install -qq gcc-4.8
   - sudo apt-get install -qq --no-install-recommends build-essential cmake python-lxml graphviz doxygen wget
   - wget http://security.ubuntu.com/ubuntu/pool/main/c/check/check_0.9.10-6ubuntu3_amd64.deb
   - sudo dpkg -i check_0.9.10-6ubuntu3_amd64.deb
   - sudo pip install cpp-coveralls
   - sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-4.8 20
   - sudo update-alternatives --config gcc
script: 
   - echo "Checking the applicability of patches"
   - ./tools/.checkPorts.sh
   - echo "Testing builds"
   - mkdir -p build
   - cd build
   - echo "Only needed profile"
   - cmake -DTYPES_ONLY_NEEDED=ON ..
   - make
   - cd ..
   - rm build -rf
   - mkdir -p build
   - cd build
   - cmake -DGENERATE_DOCUMENTATION=ON .. 
   - echo "Production build"
   - make
   - echo "Generate documentation"
   - make doc
   - echo "Debug build and unit tests"
   - make clean
   - cmake -DCMAKE_BUILD_TYPE=Debug -DENABLE_UNIT_TESTS=ON -DENABLE_COVERAGE=ON .. 
   - make && make test
   - coveralls --gcov /usr/bin/gcov-4.8 -E '.*\.h' -E '.*CMakeCXXCompilerId\.cpp' -E '.*CMakeCCompilerId\.c' -r ../
   - cd ..

after_success:
   - ./tools/.deployDoxygen.sh
   - ./tools/.coverity.sh