Radek Krejci | 562a800 | 2018-09-18 17:09:54 +0200 | [diff] [blame] | 1 | language: c |
| 2 | |
| 3 | matrix: |
| 4 | include: |
| 5 | - os: linux |
| 6 | dist: trusty |
| 7 | sudo: required |
| 8 | compiler: clang |
| 9 | - os: linux |
| 10 | dist: trusty |
| 11 | sudo: required |
| 12 | compiler: gcc |
Radek Krejci | 562a800 | 2018-09-18 17:09:54 +0200 | [diff] [blame] | 13 | - os: osx |
| 14 | compiler: gcc |
| 15 | allow_failures: |
| 16 | - os: osx |
| 17 | |
| 18 | branches: |
| 19 | only: |
| 20 | - libyang2 |
| 21 | |
| 22 | before_install: |
| 23 | - eval "${MATRIX_EVAL}" |
Radek Krejci | 59e168b | 2018-09-19 08:58:51 +0200 | [diff] [blame] | 24 | - wget https://cmocka.org/files/1.1/cmocka-1.1.2.tar.xz |
| 25 | - tar -xf cmocka-1.1.2.tar.xz |
| 26 | - cd cmocka-1.1.2; mkdir build; cd build |
Radek Krejci | 562a800 | 2018-09-18 17:09:54 +0200 | [diff] [blame] | 27 | - cmake .. && make -j2 && sudo make install |
| 28 | - cd ../.. |
| 29 | - if [ "$TRAVIS_OS_NAME" = "osx" ]; then brew update; fi |
| 30 | - if [ "$TRAVIS_OS_NAME" = "linux" ]; then sudo apt-get update -qq; sudo apt-get install -y valgrind; fi |
Radek Krejci | 73c1c32 | 2018-10-09 12:12:05 +0200 | [diff] [blame] | 31 | - if [ "$TRAVIS_OS_NAME" = "linux" -a "$CC" = "gcc" ]; then pip install --user codecov; export CFLAGS="-coverage"; fi |
Radek Krejci | 562a800 | 2018-09-18 17:09:54 +0200 | [diff] [blame] | 32 | |
| 33 | script: |
| 34 | - mkdir build && cd build |
| 35 | - if [ "$TRAVIS_OS_NAME" = "osx" ]; then cmake ..; fi |
| 36 | - if [ "$TRAVIS_OS_NAME" = "linux" ]; then cmake ..; fi |
| 37 | - make -j2 && ctest --output-on-failure |
| 38 | - cd - |
| 39 | |
| 40 | after_success: |
Radek Krejci | 73c1c32 | 2018-10-09 12:12:05 +0200 | [diff] [blame] | 41 | - if [ "$TRAVIS_OS_NAME" = "linux" -a "$CC" = "gcc" ]; then codecov; fi |