blob: c6ccb7695e48bdb27059ae707c3a24a35643d5a3 [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 Krejci12d5ec12019-04-18 15:45:40 +02007cache:
8 directories:
9 - $HOME/cache
Radek Krejci562a8002018-09-18 17:09:54 +020010
Radek Krejci48c987e2019-04-04 11:39:45 +020011stages:
12 - name: Test
13 if: type != cron
Radek Krejci48c987e2019-04-04 11:39:45 +020014 - name: Coverity
15 if: type = cron
Radek Krejci5b4b1552019-04-04 13:15:13 +020016
Radek Krejci48c987e2019-04-04 11:39:45 +020017jobs:
Radek Krejci562a8002018-09-18 17:09:54 +020018 include:
Radek Krejci48c987e2019-04-04 11:39:45 +020019 - stage: Coverity
20 name: Coverity night check
21 os: linux
Radek Krejci562a8002018-09-18 17:09:54 +020022 compiler: clang
Radek Krejci4d271eb2019-04-04 11:53:00 +020023 env:
24 # The next declaration is the encrypted COVERITY_SCAN_TOKEN, created
25 # via the "travis encrypt" command using the project repo's public key
26 - secure: "jkN1i+W2V5/ULAmpqEOyl6J6hsa9rS8JcBKsjB/Md6sJJprWKepUfQ0UdhrjBYbFJbo1mnjL0sHboTrowBXH59IQquPtw64oF9HzyMcmwr+Dm93hhm/vaI06oXwkxmnQxC0OW7Cttrmo+858lsegZYxrh2p4tgEd6WOtDpJIaQ4="
Radek Krejcid594a162019-04-04 13:39:05 +020027 addons:
28 coverity_scan:
29 project:
30 name: "CESNET/libyang"
31 notification_email: rkrejci@cesnet.cz
32 build_command_prepend: "mkdir build; cd build; cmake ..; make clean"
33 build_command: "make"
Radek Krejci034838b2019-04-05 10:13:59 +020034 branch_pattern: libyang2
Radek Krejci4d271eb2019-04-04 11:53:00 +020035 before_install:
Radek Krejci12d5ec12019-04-18 15:45:40 +020036 # check if something changed from the last coverity build
37 - if [ `git rev-parse HEAD` = `cat $HOME/cache/coveritybuild` ]; then echo "Codebase did not change from previous build."; travis_terminate 0; fi
38 - if [ ! -d $HOME/cache ]; then mkdir -p $HOME/cache; fi
39 - git rev-parse HEAD > $HOME/cache/coveritybuild
40 # get everything for coverity
41 # - 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
Radek Krejci4d271eb2019-04-04 11:53:00 +020042 - sudo apt-get update -qq
43 script:
44 # do nothing, everything here is done in coverity addon
45 - true
Radek Krejci48c987e2019-04-04 11:39:45 +020046 - stage: Test
47 name: Linux with CLang
48 os: linux
49 compiler: clang
Radek Krejci4d271eb2019-04-04 11:53:00 +020050 before_install:
51 - wget https://cmocka.org/files/1.1/cmocka-1.1.2.tar.xz
52 - tar -xf cmocka-1.1.2.tar.xz
53 - cd cmocka-1.1.2; mkdir build; cd build; cmake .. && make -j2 && sudo make install; cd ../..
54 - sudo apt-get update -qq; sudo apt-get install -y valgrind
55 script:
56 - mkdir build && cd build; cmake .. && make -j2 && ctest --output-on-failure; cd -
Radek Krejci48c987e2019-04-04 11:39:45 +020057 - stage: Test
58 name: Linux with GCC
59 os: linux
60 compiled: gcc
Radek Krejci4d271eb2019-04-04 11:53:00 +020061 before_install:
62 - wget https://cmocka.org/files/1.1/cmocka-1.1.2.tar.xz
63 - tar -xf cmocka-1.1.2.tar.xz
64 - cd cmocka-1.1.2; mkdir build; cd build; cmake .. && make -j2 && sudo make install; cd ../..
65 - sudo apt-get update -qq; sudo apt-get install -y valgrind
66 - pip install --user codecov; export CFLAGS="-coverage"
67 script:
68 - mkdir build && cd build; cmake .. && make -j2 && ctest --output-on-failure; cd -
69 after_success:
70 - codecov
Radek Krejci48c987e2019-04-04 11:39:45 +020071 - stage: Test
72 name: OS X with GCC
73 os: osx
Radek Krejci562a8002018-09-18 17:09:54 +020074 compiler: gcc
Radek Krejci48c987e2019-04-04 11:39:45 +020075 allow_failures:
76 - os: osx
Radek Krejci4d271eb2019-04-04 11:53:00 +020077 before_install:
78 - wget https://cmocka.org/files/1.1/cmocka-1.1.2.tar.xz
79 - tar -xf cmocka-1.1.2.tar.xz
80 - cd cmocka-1.1.2; mkdir build; cd build; cmake .. && make -j2 && sudo make install; cd ../..
81 - brew update
82 script:
83 - mkdir build && cd build; cmake -DENABLE_VALGRIND_TESTS=OFF .. && make -j2 && ctest --output-on-failure; cd -