aboutsummaryrefslogtreecommitdiff
path: root/.travis.yml
blob: 325b5e7b569d4ea581c4f8fa6bafa6d86044a7a7 (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
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
dist: xenial

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"
    # 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="-DUSE_BUNDLED_GPERF=OFF"
    # 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"
    - CACHE_NVIM_DEPS_DIR="$HOME/.cache/nvim-deps"
    # If this file exists, the cache is valid (compile was successful).
    - CACHE_MARKER="$CACHE_NVIM_DEPS_DIR/.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"
    # Default since 3.3, but Travis (Xenial) has 3.2.4; required with newer gcc/clang.
    - CCACHE_CPP2=1

anchors:
  envs: &common-job-env
    # Do not fall back to cache for "master" for PR on "release" branch:
    # adds the target branch to the cache key.
    FOR_TRAVIS_CACHE=v1-$TRAVIS_BRANCH

addons:
  apt:
    packages: &common-apt-packages
      - apport
      - autoconf
      - automake
      - build-essential
      - clang
      - cmake
      - cscope
      - gcc-multilib
      - gdb
      - gperf
      - language-pack-tr
      - libc6-dev-i386
      - libtool-bin
      - locales
      - ninja-build
      - pkg-config
      - unzip
      - valgrind
      - xclip
  homebrew:
    update: false
    packages:
      - ccache
      - ninja

jobs:
  include:
    - stage: baseline
      name: clang-asan
      os: linux
      compiler: clang
      # Use Lua so that ASAN can test our embedded Lua support. 8fec4d53d0f6
      env:
        - CLANG_SANITIZER=ASAN_UBSAN
        - CMAKE_FLAGS="$CMAKE_FLAGS -DPREFER_LUA=ON"
        - *common-job-env
    - name: gcc-coverage (gcc 9)
      os: linux
      compiler: gcc-9
      env:
        - GCOV=gcov-9
        - CMAKE_FLAGS="$CMAKE_FLAGS -DUSE_GCOV=ON"
        - GCOV_ERROR_FILE="/tmp/libgcov-errors.log"
        - *common-job-env
      addons:
        apt:
          sources:
            - sourceline: 'ppa:ubuntu-toolchain-r/test'
          packages:
            - *common-apt-packages
            - gcc-9
    - if: branch = master AND commit_message !~ /\[skip.lint\]/
      name: lint
      os: linux
      env:
        - CI_TARGET=lint
        - *common-job-env

    - stage: second stage
      name: "macOS: clang"
      os: osx
      compiler: clang
      osx_image: xcode10.2  # macOS 10.14
      env:
        - *common-job-env
    - name: gcc-functionaltest-lua
      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"
        - *common-job-env
    - name: gcc-32bit
      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
        # Minimum required CMake.
        - CMAKE_URL=https://cmake.org/files/v2.8/cmake-2.8.12-Linux-i386.sh
        - *common-job-env
    - name: clang-tsan
      os: linux
      compiler: clang
      env:
        - CLANG_SANITIZER=TSAN
        - *common-job-env
  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

branches:
  only:
    - master
    - /^release-\d+\.\d+$/

cache:
  apt: true
  ccache: true
  directories:
    - "$CACHE_NVIM_DEPS_DIR"

git:
  quiet: true

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