Travis: use clang and gcc
[lorikeet-heimdal.git] / .travis.yml
1 os:
2     - linux
3     - osx
4
5 language: c
6
7 env:
8     global:
9         secure: "YKG77M7zMvJ+IeV2ziw//HcHqMqFoAzIZlE99Yw/aOn5pvMYKq6Ep7EFVhbfDu9yN0T7M5csCGQeH7/ylDlsZSRMUw72844ezMDM8e10T/lW/T/OYN7j1ZVHh3WSJgS+1D9VG6/Y0OY1Si3lb7PcOdAIU0fPJV5xQONN2+hpJeI="
10
11 before_install:
12     - if [ $TRAVIS_OS_NAME = linux ]; then sudo apt-get update -qq; fi
13     - if [ $TRAVIS_OS_NAME = linux ]; then sudo apt-get install -qq bison comerr-dev flex libcap-ng-dev libdb-dev libedit-dev libjson-perl libldap2-dev libncurses5-dev libperl4-corelibs-perl libsqlite3-dev pkg-config python ss-dev texinfo unzip netbase; fi
14     - if [ $TRAVIS_OS_NAME = osx ]; then brew update; fi
15     - if [ $TRAVIS_OS_NAME = osx ]; then brew install cpanm bison flex berkeley-db lmdb openldap openssl; fi
16     - if [ $TRAVIS_OS_NAME = osx ]; then sudo cpanm install JSON; fi
17     - mkdir ci-build
18     - mkdir coverity-build
19     - ./autogen.sh
20
21 install:
22     - cd ci-build
23     - if [ -n "$COVERAGE" ]; then pip install --user cpp-coveralls; fi
24     - |
25       if [ $TRAVIS_OS_NAME = osx ]; then
26           LDFLAGS="-L/usr/local/opt/berkeley-db/lib -L/usr/local/opt/lmdb/lib" \
27           CFLAGS="-I/usr/local/opt/lmdb/include" \
28           ../configure --prefix=/tmp/heimdal \
29                   --enable-static=no \
30                   --enable-pthread-support \
31                   --disable-afs-support \
32                   --disable-ndbm-db \
33                   --with-openldap=/usr/local/opt/openldap \
34                   --with-openssl=/usr/local/opt/openssl/ \
35                   --with-hcrypto-default-backend=ossl \
36                   --with-berkeley-db \
37                   --with-berkeley-db-include=/usr/local/opt/berkeley-db/include
38       else
39           ../configure --enable-maintainer-mode $COVERAGE
40       fi
41     - make -j3
42
43 script:
44     - if [ x${COVERITY_SCAN_BRANCH} != x1 ]; then make check; fi
45
46 after_script:
47     - if [ -n "$COVERAGE" ]; then coveralls --gcov-options; fi
48
49 compiler:
50     - clang
51     - gcc
52
53 matrix:
54     # Don't build on OS X with gcc
55     exclude:
56       - os: osx
57         compiler: gcc
58     # Add a gcov build
59     include:
60         - compiler: gcc
61           env: COVERAGE="--enable-gcov"
62           os: linux
63     # The gcov build is not working quite yet
64     allow_failures:
65         compiler: gcc
66         env: COVERAGE="--enable-gcov"
67         os: linux
68
69 notifications:
70     email:
71         on_success: change
72         on_failure: always
73
74 addons:
75
76     coverity_scan:
77         project:
78             name: "heimdal/heimdal"
79             description: "Build submitted via Travis CI"
80         notification_email: heimdal-builders@secure-endpoints.com
81         build_command_prepend: ../configure --enable-maintainer-mode
82         build_command: make
83         branch_pattern: coverity_scan