Radek Krejci | 562a800 | 2018-09-18 17:09:54 +0200 | [diff] [blame] | 1 | language: c |
Radek Krejci | 48c987e | 2019-04-04 11:39:45 +0200 | [diff] [blame] | 2 | sudo: required |
| 3 | dist: trusty |
Radek Krejci | 034838b | 2019-04-05 10:13:59 +0200 | [diff] [blame] | 4 | branches: |
| 5 | only: |
| 6 | - libyang2 |
Radek Krejci | 562a800 | 2018-09-18 17:09:54 +0200 | [diff] [blame] | 7 | |
Radek Krejci | 48c987e | 2019-04-04 11:39:45 +0200 | [diff] [blame] | 8 | stages: |
| 9 | - name: Test |
| 10 | if: type != cron |
Radek Krejci | 48c987e | 2019-04-04 11:39:45 +0200 | [diff] [blame] | 11 | - name: Coverity |
| 12 | if: type = cron |
Radek Krejci | 5b4b155 | 2019-04-04 13:15:13 +0200 | [diff] [blame] | 13 | |
Radek Krejci | 48c987e | 2019-04-04 11:39:45 +0200 | [diff] [blame] | 14 | jobs: |
Radek Krejci | 562a800 | 2018-09-18 17:09:54 +0200 | [diff] [blame] | 15 | include: |
Radek Krejci | 48c987e | 2019-04-04 11:39:45 +0200 | [diff] [blame] | 16 | - stage: Coverity |
| 17 | name: Coverity night check |
| 18 | os: linux |
Radek Krejci | 562a800 | 2018-09-18 17:09:54 +0200 | [diff] [blame] | 19 | compiler: clang |
Radek Krejci | 4d271eb | 2019-04-04 11:53:00 +0200 | [diff] [blame] | 20 | env: |
| 21 | # The next declaration is the encrypted COVERITY_SCAN_TOKEN, created |
| 22 | # via the "travis encrypt" command using the project repo's public key |
| 23 | - secure: "jkN1i+W2V5/ULAmpqEOyl6J6hsa9rS8JcBKsjB/Md6sJJprWKepUfQ0UdhrjBYbFJbo1mnjL0sHboTrowBXH59IQquPtw64oF9HzyMcmwr+Dm93hhm/vaI06oXwkxmnQxC0OW7Cttrmo+858lsegZYxrh2p4tgEd6WOtDpJIaQ4=" |
Radek Krejci | d594a16 | 2019-04-04 13:39:05 +0200 | [diff] [blame] | 24 | addons: |
| 25 | coverity_scan: |
| 26 | project: |
| 27 | name: "CESNET/libyang" |
| 28 | notification_email: rkrejci@cesnet.cz |
| 29 | build_command_prepend: "mkdir build; cd build; cmake ..; make clean" |
| 30 | build_command: "make" |
Radek Krejci | 034838b | 2019-04-05 10:13:59 +0200 | [diff] [blame] | 31 | branch_pattern: libyang2 |
Radek Krejci | 4d271eb | 2019-04-04 11:53:00 +0200 | [diff] [blame] | 32 | before_install: |
| 33 | - echo -n | openssl s_client -connect scan.coverity.com:443 | sed -ne '/-BEGIN CERTIFICATE-/,/-END CERTIFICATE-/p' | sudo tee -a /etc/ssl/certs/ca-certificates.crt |
| 34 | - sudo apt-get update -qq |
| 35 | script: |
| 36 | # do nothing, everything here is done in coverity addon |
| 37 | - true |
Radek Krejci | 48c987e | 2019-04-04 11:39:45 +0200 | [diff] [blame] | 38 | - stage: Test |
| 39 | name: Linux with CLang |
| 40 | os: linux |
| 41 | compiler: clang |
Radek Krejci | 4d271eb | 2019-04-04 11:53:00 +0200 | [diff] [blame] | 42 | before_install: |
| 43 | - wget https://cmocka.org/files/1.1/cmocka-1.1.2.tar.xz |
| 44 | - tar -xf cmocka-1.1.2.tar.xz |
| 45 | - cd cmocka-1.1.2; mkdir build; cd build; cmake .. && make -j2 && sudo make install; cd ../.. |
| 46 | - sudo apt-get update -qq; sudo apt-get install -y valgrind |
| 47 | script: |
| 48 | - mkdir build && cd build; cmake .. && make -j2 && ctest --output-on-failure; cd - |
Radek Krejci | 48c987e | 2019-04-04 11:39:45 +0200 | [diff] [blame] | 49 | - stage: Test |
| 50 | name: Linux with GCC |
| 51 | os: linux |
| 52 | compiled: gcc |
Radek Krejci | 4d271eb | 2019-04-04 11:53:00 +0200 | [diff] [blame] | 53 | before_install: |
| 54 | - wget https://cmocka.org/files/1.1/cmocka-1.1.2.tar.xz |
| 55 | - tar -xf cmocka-1.1.2.tar.xz |
| 56 | - cd cmocka-1.1.2; mkdir build; cd build; cmake .. && make -j2 && sudo make install; cd ../.. |
| 57 | - sudo apt-get update -qq; sudo apt-get install -y valgrind |
| 58 | - pip install --user codecov; export CFLAGS="-coverage" |
| 59 | script: |
| 60 | - mkdir build && cd build; cmake .. && make -j2 && ctest --output-on-failure; cd - |
| 61 | after_success: |
| 62 | - codecov |
Radek Krejci | 48c987e | 2019-04-04 11:39:45 +0200 | [diff] [blame] | 63 | - stage: Test |
| 64 | name: OS X with GCC |
| 65 | os: osx |
Radek Krejci | 562a800 | 2018-09-18 17:09:54 +0200 | [diff] [blame] | 66 | compiler: gcc |
Radek Krejci | 48c987e | 2019-04-04 11:39:45 +0200 | [diff] [blame] | 67 | allow_failures: |
| 68 | - os: osx |
Radek Krejci | 4d271eb | 2019-04-04 11:53:00 +0200 | [diff] [blame] | 69 | before_install: |
| 70 | - wget https://cmocka.org/files/1.1/cmocka-1.1.2.tar.xz |
| 71 | - tar -xf cmocka-1.1.2.tar.xz |
| 72 | - cd cmocka-1.1.2; mkdir build; cd build; cmake .. && make -j2 && sudo make install; cd ../.. |
| 73 | - brew update |
| 74 | script: |
| 75 | - mkdir build && cd build; cmake -DENABLE_VALGRIND_TESTS=OFF .. && make -j2 && ctest --output-on-failure; cd - |