blob: ee98acadff155ffa14e0d85cb2bb42f450155a8f [file] [log] [blame]
Radek Krejci562a8002018-09-18 17:09:54 +02001language: c
Radek Krejci48c987e2019-04-04 11:39:45 +02002sudo: required
3dist: trusty
Radek Krejci034838b2019-04-05 10:13:59 +02004branches:
5 only:
6 - libyang2
Radek Krejci562a8002018-09-18 17:09:54 +02007
Radek Krejci48c987e2019-04-04 11:39:45 +02008stages:
9 - name: Test
10 if: type != cron
Radek Krejci48c987e2019-04-04 11:39:45 +020011 - name: Coverity
12 if: type = cron
Radek Krejci5b4b1552019-04-04 13:15:13 +020013
Radek Krejci48c987e2019-04-04 11:39:45 +020014jobs:
Radek Krejci562a8002018-09-18 17:09:54 +020015 include:
Radek Krejci48c987e2019-04-04 11:39:45 +020016 - stage: Coverity
17 name: Coverity night check
18 os: linux
Radek Krejci562a8002018-09-18 17:09:54 +020019 compiler: clang
Radek Krejci4d271eb2019-04-04 11:53:00 +020020 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 Krejcid594a162019-04-04 13:39:05 +020024 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 Krejci034838b2019-04-05 10:13:59 +020031 branch_pattern: libyang2
Radek Krejci4d271eb2019-04-04 11:53:00 +020032 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 Krejci48c987e2019-04-04 11:39:45 +020038 - stage: Test
39 name: Linux with CLang
40 os: linux
41 compiler: clang
Radek Krejci4d271eb2019-04-04 11:53:00 +020042 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 Krejci48c987e2019-04-04 11:39:45 +020049 - stage: Test
50 name: Linux with GCC
51 os: linux
52 compiled: gcc
Radek Krejci4d271eb2019-04-04 11:53:00 +020053 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 Krejci48c987e2019-04-04 11:39:45 +020063 - stage: Test
64 name: OS X with GCC
65 os: osx
Radek Krejci562a8002018-09-18 17:09:54 +020066 compiler: gcc
Radek Krejci48c987e2019-04-04 11:39:45 +020067 allow_failures:
68 - os: osx
Radek Krejci4d271eb2019-04-04 11:53:00 +020069 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 -