aboutsummaryrefslogtreecommitdiff
path: root/.travis.yml
blob: fa884bd021df37bbf0492c0dbf99b5c910b1f58c (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
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
dist: trusty
sudo: false
language: c

env:
  global:
    # Set "false" to force rebuild of third-party dependencies.
    - CACHE_ENABLE=true
    # Build directory for Neovim.
    - BUILD_DIR="$TRAVIS_BUILD_DIR/build"
    # Build directory for third-party dependencies.
    - DEPS_BUILD_DIR="$HOME/nvim-deps"
    # Directory where third-party dependency sources are downloaded to.
    - DEPS_DOWNLOAD_DIR="$TRAVIS_BUILD_DIR/deps-downloads"
    # Install directory for Neovim.
    - INSTALL_PREFIX="$HOME/nvim-install"
    # Log directory for Clang sanitizers and Valgrind.
    - LOG_DIR="$BUILD_DIR/log"
    # Nvim log file.
    - NVIM_LOG_FILE="$BUILD_DIR/.nvimlog"
    # Default CMake flags.
    - CMAKE_FLAGS="-DTRAVIS_CI_BUILD=ON
                   -DCMAKE_BUILD_TYPE=Debug
                   -DCMAKE_INSTALL_PREFIX:PATH=$INSTALL_PREFIX
                   -DBUSTED_OUTPUT_TYPE=nvim
                   -DDEPS_PREFIX=$DEPS_BUILD_DIR/usr
                   -DMIN_LOG_LEVEL=3"
    - DEPS_CMAKE_FLAGS="-DDEPS_DOWNLOAD_DIR:PATH=$DEPS_DOWNLOAD_DIR"
    # Additional CMake flags for 32-bit builds.
    - CMAKE_FLAGS_32BIT="-DCMAKE_SYSTEM_LIBRARY_PATH=/lib32:/usr/lib32:/usr/local/lib32
                         -DCMAKE_IGNORE_PATH=/lib:/usr/lib:/usr/local/lib
                         -DCMAKE_TOOLCHAIN_FILE=$TRAVIS_BUILD_DIR/cmake/i386-linux-gnu.toolchain.cmake"
    # Environment variables for Clang sanitizers.
    - ASAN_OPTIONS="detect_leaks=1:check_initialization_order=1:log_path=$LOG_DIR/asan"
    - TSAN_OPTIONS="log_path=$LOG_DIR/tsan"
    - UBSAN_OPTIONS="print_stacktrace=1 log_path=$LOG_DIR/ubsan"
    # Environment variables for Valgrind.
    - VALGRIND_LOG="$LOG_DIR/valgrind-%p.log"
    # If this file exists, the cache is valid (compile was successful).
    - CACHE_MARKER="$HOME/.cache/nvim-deps/.travis_cache_marker"
    # default target name for functional tests
    - FUNCTIONALTEST=functionaltest
    - CI_TARGET=tests
    # Environment variables for ccache
    - CCACHE_COMPRESS=1
    - CCACHE_SLOPPINESS=time_macros,file_macro
    - CCACHE_BASEDIR="$TRAVIS_BUILD_DIR"

jobs:
  include:
    - stage: normal builds
      os: linux
      compiler: clang
      env: >
        CLANG_SANITIZER=ASAN_UBSAN
        # Use Lua so that ASAN can test our embedded Lua support. 8fec4d53d0f6
        CMAKE_FLAGS="$CMAKE_FLAGS -DPREFER_LUA=ON"
      sudo: true
    - os: linux
      compiler: gcc
      env: >
        FUNCTIONALTEST=functionaltest-lua
        CMAKE_FLAGS="$CMAKE_FLAGS -DPREFER_LUA=ON"
        DEPS_CMAKE_FLAGS="$DEPS_CMAKE_FLAGS -DUSE_BUNDLED_LUAJIT=OFF"
    - os: linux
      # Travis creates a cache per compiler. Set a different value here to
      # store 32-bit dependencies in a separate cache.
      compiler: gcc
      env: BUILD_32BIT=ON
    - os: osx
      compiler: clang
      osx_image: xcode7.3  # macOS 10.11
    - os: osx
      compiler: gcc
      osx_image: xcode7.3  # macOS 10.11
    - os: linux
      env: CI_TARGET=lint
    - stage: Flaky builds
      os: linux
      compiler: gcc
      env: GCOV=gcov CMAKE_FLAGS="$CMAKE_FLAGS -DUSE_GCOV=ON"
    - os: linux
      compiler: clang
      env: CLANG_SANITIZER=TSAN
  allow_failures:
    - env: GCOV=gcov CMAKE_FLAGS="$CMAKE_FLAGS -DUSE_GCOV=ON"
    - env: CLANG_SANITIZER=TSAN
  fast_finish: true

before_install: ci/before_install.sh
install:        ci/install.sh
before_script:  ci/before_script.sh
script:         ci/script.sh
before_cache:   ci/before_cache.sh

addons:
  apt:
    packages:
      - autoconf
      - automake
      - apport
      - build-essential
      - clang
      - cmake
      - cscope
      - g++-multilib
      - gcc-multilib
      - gdb
      - language-pack-tr
      - libc6-dev-i386
      - libtool
      - locales
      - ninja-build
      - pkg-config
      - unzip
      - valgrind
      - xclip

branches:
  except:
    - nightly

cache:
  apt: true
  ccache: true
  directories:
    - "$HOME/.cache/pip"
    - "$HOME/.cache/nvim-deps"
    - "$HOME/.cache/nvim-deps-downloads"

notifications:
  webhooks:
    urls:
      - https://webhooks.gitter.im/e/b5c38c99f9677aa3d031