.travis.yml 4.22 KB
Newer Older
1 2
dist: xenial

3
language: c
4

5
env:
6
  global:
7 8
    # Set "false" to force rebuild of third-party dependencies.
    - CACHE_ENABLE=true
9 10 11
    # Build directory for Neovim.
    - BUILD_DIR="$TRAVIS_BUILD_DIR/build"
    # Build directory for third-party dependencies.
12 13 14
    - DEPS_BUILD_DIR="$HOME/nvim-deps"
    # Directory where third-party dependency sources are downloaded to.
    - DEPS_DOWNLOAD_DIR="$TRAVIS_BUILD_DIR/deps-downloads"
15 16 17 18
    # Install directory for Neovim.
    - INSTALL_PREFIX="$HOME/nvim-install"
    # Log directory for Clang sanitizers and Valgrind.
    - LOG_DIR="$BUILD_DIR/log"
19 20
    # Nvim log file.
    - NVIM_LOG_FILE="$BUILD_DIR/.nvimlog"
21 22 23 24
    # Default CMake flags.
    - CMAKE_FLAGS="-DTRAVIS_CI_BUILD=ON
                   -DCMAKE_BUILD_TYPE=Debug
                   -DCMAKE_INSTALL_PREFIX:PATH=$INSTALL_PREFIX
25
                   -DBUSTED_OUTPUT_TYPE=nvim
26
                   -DDEPS_PREFIX=$DEPS_BUILD_DIR/usr
27
                   -DMIN_LOG_LEVEL=3"
28
    - DEPS_CMAKE_FLAGS="-DDEPS_DOWNLOAD_DIR:PATH=$DEPS_DOWNLOAD_DIR -DUSE_BUNDLED_GPERF=OFF"
29 30 31 32 33 34
    # 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"
35
    - TSAN_OPTIONS="log_path=$LOG_DIR/tsan"
36
    - UBSAN_OPTIONS="print_stacktrace=1 log_path=$LOG_DIR/ubsan"
37
    - ASAN_SYMBOLIZE=asan_symbolize
38 39
    # Environment variables for Valgrind.
    - VALGRIND_LOG="$LOG_DIR/valgrind-%p.log"
40
    # If this file exists, the cache is valid (compile was successful).
41
    - CACHE_MARKER="$HOME/.cache/nvim-deps/.travis_cache_marker"
42 43
    # default target name for functional tests
    - FUNCTIONALTEST=functionaltest
ZyX's avatar
ZyX committed
44
    - CI_TARGET=tests
James McCoy's avatar
James McCoy committed
45 46 47 48
    # Environment variables for ccache
    - CCACHE_COMPRESS=1
    - CCACHE_SLOPPINESS=time_macros,file_macro
    - CCACHE_BASEDIR="$TRAVIS_BUILD_DIR"
49

50
jobs:
51
  include:
52
    - stage: normal builds
53
      os: linux
54
      compiler: clang-4.0
Justin M. Keyes's avatar
Justin M. Keyes committed
55
      # Use Lua so that ASAN can test our embedded Lua support. 8fec4d53d0f6
56 57 58
      env: >
        CLANG_SANITIZER=ASAN_UBSAN
        CMAKE_FLAGS="$CMAKE_FLAGS -DPREFER_LUA=ON"
59
        ASAN_SYMBOLIZE=asan_symbolize-4.0
60
    - os: linux
61
      compiler: gcc
62 63 64 65
      env: >
        FUNCTIONALTEST=functionaltest-lua
        CMAKE_FLAGS="$CMAKE_FLAGS -DPREFER_LUA=ON"
        DEPS_CMAKE_FLAGS="$DEPS_CMAKE_FLAGS -DUSE_BUNDLED_LUAJIT=OFF"
66
    - os: linux
67 68
      # Travis creates a cache per compiler. Set a different value here to
      # store 32-bit dependencies in a separate cache.
69
      compiler: gcc
70
      env: BUILD_32BIT=ON
71
    - os: osx
Florian Walch's avatar
Florian Walch committed
72
      compiler: clang
73
      osx_image: xcode9.4  # macOS 10.13
74
    - os: osx
75
      compiler: gcc
76
      osx_image: xcode9.4  # macOS 10.13
77 78
    - if: branch = master
      os: linux
79
      env: CI_TARGET=lint
80
    - stage: Flaky builds
81
      os: linux
82 83
      compiler: gcc
      env: GCOV=gcov CMAKE_FLAGS="$CMAKE_FLAGS -DUSE_GCOV=ON"
84
    - os: linux
85
      compiler: clang
86
      env: CLANG_SANITIZER=TSAN
87
  allow_failures:
88
    - env: GCOV=gcov CMAKE_FLAGS="$CMAKE_FLAGS -DUSE_GCOV=ON"
89
    - env: CLANG_SANITIZER=TSAN
90
  fast_finish: true
91

92 93 94 95 96
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
97 98 99 100

addons:
  apt:
    packages:
101
      - apport
102 103 104
      - autoconf
      - automake
      - build-essential
105
      - clang-4.0
106
      - cmake
107
      - cscope
108 109
      - g++-multilib
      - gcc-multilib
110
      - gdb
111
      - gperf
112
      - language-pack-tr
113
      - libc6-dev-i386
114
      - libtool-bin
115
      - locales
116
      - ninja-build
117 118
      - pkg-config
      - unzip
119
      - valgrind
120
      - xclip
121 122 123 124 125
  homebrew:
    update: true
    packages:
      - ccache
      - ninja
126 127

branches:
128 129
  only:
    - master
130
    - /^release-\d+\.\d+$/
131 132 133

cache:
  apt: true
James McCoy's avatar
James McCoy committed
134
  ccache: true
135 136 137
  directories:
    - "$HOME/.cache/pip"
    - "$HOME/.cache/nvim-deps"
138
    - "$HOME/.cache/nvim-deps-downloads"
139

140 141 142 143
notifications:
  webhooks:
    urls:
      - https://webhooks.gitter.im/e/b5c38c99f9677aa3d031