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 | 562a800 | 2018-09-18 17:09:54 +0200 | [diff] [blame] | 4 | |
Radek Krejci | 48c987e | 2019-04-04 11:39:45 +0200 | [diff] [blame^] | 5 | env: |
| 6 | global: |
| 7 | # The next declaration is the encrypted COVERITY_SCAN_TOKEN, created |
| 8 | # via the "travis encrypt" command using the project repo's public key |
| 9 | - secure: "jkN1i+W2V5/ULAmpqEOyl6J6hsa9rS8JcBKsjB/Md6sJJprWKepUfQ0UdhrjBYbFJbo1mnjL0sHboTrowBXH59IQquPtw64oF9HzyMcmwr+Dm93hhm/vaI06oXwkxmnQxC0OW7Cttrmo+858lsegZYxrh2p4tgEd6WOtDpJIaQ4=" |
| 10 | |
| 11 | stages: |
| 12 | - name: Test |
| 13 | if: type != cron |
| 14 | before_install: |
| 15 | - wget https://cmocka.org/files/1.1/cmocka-1.1.2.tar.xz |
| 16 | - tar -xf cmocka-1.1.2.tar.xz |
| 17 | - cd cmocka-1.1.2; mkdir build; cd build |
| 18 | - cmake .. && make -j2 && sudo make install |
| 19 | - cd ../.. |
| 20 | - if [ "$TRAVIS_OS_NAME" = "osx" ]; then brew update; fi |
| 21 | - if [ "$TRAVIS_OS_NAME" = "linux" ]; then sudo apt-get update -qq; sudo apt-get install -y valgrind; fi |
| 22 | - if [ "$TRAVIS_OS_NAME" = "linux" -a "$CC" = "gcc" ]; then pip install --user codecov; export CFLAGS="-coverage"; fi |
| 23 | script: |
| 24 | - mkdir build && cd build |
| 25 | - if [ "$TRAVIS_OS_NAME" = "osx" ]; then cmake -DENABLE_VALGRIND_TESTS=OFF ..; fi |
| 26 | - if [ "$TRAVIS_OS_NAME" = "linux" ]; then cmake ..; fi |
| 27 | - make -j2 && ctest --output-on-failure |
| 28 | - cd - |
| 29 | after_success: |
| 30 | - if [ "$TRAVIS_OS_NAME" = "linux" -a "$CC" = "gcc" ]; then codecov; fi |
| 31 | - name: Coverity |
| 32 | if: type = cron |
| 33 | env: |
| 34 | # The next declaration is the encrypted COVERITY_SCAN_TOKEN, created |
| 35 | # via the "travis encrypt" command using the project repo's public key |
| 36 | - secure: "jkN1i+W2V5/ULAmpqEOyl6J6hsa9rS8JcBKsjB/Md6sJJprWKepUfQ0UdhrjBYbFJbo1mnjL0sHboTrowBXH59IQquPtw64oF9HzyMcmwr+Dm93hhm/vaI06oXwkxmnQxC0OW7Cttrmo+858lsegZYxrh2p4tgEd6WOtDpJIaQ4=" |
| 37 | before_install: |
| 38 | - 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 |
| 39 | - sudo apt-get update -qq |
| 40 | script: |
| 41 | # do nothing, everything here is done in coverity addon |
| 42 | - true |
| 43 | |
| 44 | jobs: |
Radek Krejci | 562a800 | 2018-09-18 17:09:54 +0200 | [diff] [blame] | 45 | include: |
Radek Krejci | 48c987e | 2019-04-04 11:39:45 +0200 | [diff] [blame^] | 46 | - stage: Coverity |
| 47 | name: Coverity night check |
| 48 | os: linux |
Radek Krejci | 562a800 | 2018-09-18 17:09:54 +0200 | [diff] [blame] | 49 | compiler: clang |
Radek Krejci | 48c987e | 2019-04-04 11:39:45 +0200 | [diff] [blame^] | 50 | addons: |
| 51 | coverity_scan: |
| 52 | project: |
| 53 | name: "CESNET/libyang" |
| 54 | notification_email: rkrejci@cesnet.cz |
| 55 | build_command_prepend: "mkdir build; cd build; cmake ..; make clean" |
| 56 | build_command: "make" |
| 57 | branches: |
| 58 | only: |
| 59 | - libyang2 |
| 60 | - stage: Test |
| 61 | name: Linux with CLang |
| 62 | os: linux |
| 63 | compiler: clang |
| 64 | branches: |
| 65 | only: |
| 66 | - libyang2 |
| 67 | - stage: Test |
| 68 | name: Linux with GCC |
| 69 | os: linux |
| 70 | compiled: gcc |
| 71 | branches: |
| 72 | only: |
| 73 | - libyang2 |
| 74 | - stage: Test |
| 75 | name: OS X with GCC |
| 76 | os: osx |
Radek Krejci | 562a800 | 2018-09-18 17:09:54 +0200 | [diff] [blame] | 77 | compiler: gcc |
Radek Krejci | 48c987e | 2019-04-04 11:39:45 +0200 | [diff] [blame^] | 78 | allow_failures: |
| 79 | - os: osx |
| 80 | branches: |
| 81 | only: |
| 82 | - libyang2 |