aboutsummaryrefslogtreecommitdiff
path: root/.travis.yml
blob: d464d67bb1d8dc0dcfd093fc95c7f348b38877db (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
language: c
os:
  - linux
env:
  global:
    - CI_SCRIPTS=$TRAVIS_BUILD_DIR/.ci
    # To build third-party dependencies, set this to 'true'.
    - BUILD_NVIM_DEPS=false
    # Travis reports back that it has 32-cores via /proc/cpuinfo, but it's not
    # what we really have available.  According to their documentation, it only has
    # 1.5 virtual cores.
    # See
    #   http://docs.travis-ci.com/user/speeding-up-the-build/#Paralellizing-your-build-on-one-VM
    # for more information.
    - MAKE_CMD="make -j2"
    # Force verification of DLOG macros.
    - CFLAGS='-DMIN_LOG_LEVEL=0'
  matrix:
    - CI_TARGET=clang
    - CI_TARGET=gcc
    - CI_TARGET=gcc-32
    - CI_TARGET=clint
matrix:
  include:
    - os: osx
      env: CI_TARGET=clang
      compiler: clang
    - os: osx
      env: CI_TARGET=gcc
      compiler: gcc-4.9
  fast_finish: true
before_install:
  # Pins the version of the java package installed on the Travis VMs
  # and avoids a lengthy upgrade process for them.
  - if [ $TRAVIS_OS_NAME = linux ]; then
      sudo apt-mark hold oracle-java7-installer oracle-java8-installer;
      sudo apt-get update;
    elif [ $TRAVIS_OS_NAME = osx ]; then
      brew update;
    fi
install:
  - if [ $TRAVIS_OS_NAME = linux ]; then
      sudo apt-get install xclip gdb;
    elif [ $TRAVIS_OS_NAME = osx ]; then
      brew install gettext;
    fi
before_script:
  # Adds user to a dummy group.
  # That allows to test changing the group of the file by `os_fchown`.
  # Need xvfb for running some tests with xclip
  - if [ $TRAVIS_OS_NAME = linux ]; then
      sudo groupadd chown_test;
      sudo usermod -a -G chown_test $USER;
      export DISPLAY=:99.0;
      sh -e /etc/init.d/xvfb start;
    elif [ $TRAVIS_OS_NAME = osx ]; then
      sudo dscl . -create /Groups/chown_test;
      sudo dscl . -append /Groups/chown_test GroupMembership $USER;
    fi
script:
  # This will pass the environment variables down to a bash process which runs
  # as $USER, while retaining the environment variables defined and belonging
  # to secondary groups given above in usermod.
  - sudo -E su $USER -c "sh -e \"$CI_SCRIPTS/$CI_TARGET.sh\""