You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

231 lines
6.8KB

  1. dist: xenial
  2. language: c
  3. env:
  4. global:
  5. # Encrypted environment variables, see
  6. # http://docs.travis-ci.com/user/encryption-keys/
  7. #
  8. # SNAP_SECRET_KEY: generated by:
  9. # travis encrypt SNAP_SECRET_KEY=xx --add
  10. # https://github.com/neovim/neovim/pull/11428
  11. # snapcraft key expires after 1 year. Steps to refresh it:
  12. # 1. snapcraft enable-ci travis --refresh
  13. # 2. mv .snapcraft/travis_snapcraft.cfg ci/snap/travis_snapcraft.cfg
  14. # 3. Copy after_success command to ci/snap/deploy.sh from .travis.yml
  15. # 4. Undo changes to .travis.yml
  16. - secure: hd0qn2u8ABbJg5Bx4pBRcUQbKYFmcSHoecyHIPTCnGJT+NI41Bvm/IkN/N5DhBF+LbD3Q2nmR/dzI5H/dqS7RxMFvEx1DuFLendFHHX3MYf0AuKpXYY3gwgMTmqx8p/v6srlU7RBGWNGzHCWqksAem+EIWCe3I7WvfdKo1/DV/Y=
  17. # Set "false" to force rebuild of third-party dependencies.
  18. - CACHE_ENABLE=true
  19. # Build directory for Neovim.
  20. - BUILD_DIR="$TRAVIS_BUILD_DIR/build"
  21. # Build directory for third-party dependencies.
  22. - DEPS_BUILD_DIR="$HOME/nvim-deps"
  23. # Install directory for Neovim.
  24. - INSTALL_PREFIX="$HOME/nvim-install"
  25. # Log directory for Clang sanitizers and Valgrind.
  26. - LOG_DIR="$BUILD_DIR/log"
  27. # Nvim log file.
  28. - NVIM_LOG_FILE="$BUILD_DIR/.nvimlog"
  29. # Default CMake flags.
  30. - CMAKE_FLAGS="-DTRAVIS_CI_BUILD=ON
  31. -DCMAKE_BUILD_TYPE=Debug
  32. -DCMAKE_INSTALL_PREFIX:PATH=$INSTALL_PREFIX
  33. -DBUSTED_OUTPUT_TYPE=nvim
  34. -DDEPS_PREFIX=$DEPS_BUILD_DIR/usr
  35. -DMIN_LOG_LEVEL=3"
  36. - DEPS_CMAKE_FLAGS="-DUSE_BUNDLED_GPERF=OFF"
  37. # Environment variables for Clang sanitizers.
  38. - ASAN_OPTIONS="detect_leaks=1:check_initialization_order=1:log_path=$LOG_DIR/asan"
  39. - TSAN_OPTIONS="log_path=$LOG_DIR/tsan"
  40. - UBSAN_OPTIONS="print_stacktrace=1 log_path=$LOG_DIR/ubsan"
  41. # Environment variables for Valgrind.
  42. - VALGRIND_LOG="$LOG_DIR/valgrind-%p.log"
  43. - CACHE_NVIM_DEPS_DIR="$HOME/.cache/nvim-deps"
  44. # If this file exists, the cache is valid (compile was successful).
  45. - CACHE_MARKER="$CACHE_NVIM_DEPS_DIR/.travis_cache_marker"
  46. # default target name for functional tests
  47. - FUNCTIONALTEST=functionaltest
  48. - CI_TARGET=tests
  49. # Environment variables for ccache
  50. - CCACHE_COMPRESS=1
  51. - CCACHE_SLOPPINESS=time_macros,file_macro
  52. - CCACHE_BASEDIR="$TRAVIS_BUILD_DIR"
  53. # Default since 3.3, but Travis (Xenial) has 3.2.4; required with newer gcc/clang.
  54. - CCACHE_CPP2=1
  55. anchors:
  56. envs: &common-job-env
  57. # Do not fall back to cache for "master" for PR on "release" branch:
  58. # adds the target branch to the cache key.
  59. FOR_TRAVIS_CACHE=v1-$TRAVIS_BRANCH
  60. addons:
  61. apt:
  62. packages: &common-apt-packages
  63. - apport
  64. - autoconf
  65. - automake
  66. - build-essential
  67. - clang
  68. - cmake
  69. - cpanminus
  70. - cscope
  71. - gcc-multilib
  72. - gdb
  73. - gperf
  74. - language-pack-tr
  75. - libc6-dev-i386
  76. - libtool-bin
  77. - locales
  78. - ninja-build
  79. - pkg-config
  80. - unzip
  81. - valgrind
  82. - xclip
  83. homebrew:
  84. update: true
  85. casks:
  86. - powershell
  87. packages:
  88. - ccache
  89. - cpanminus
  90. - ninja
  91. - perl
  92. jobs:
  93. include:
  94. - stage: baseline
  95. name: clang-asan
  96. os: linux
  97. compiler: clang
  98. # Use Lua so that ASAN can test our embedded Lua support. 8fec4d53d0f6
  99. env:
  100. - CLANG_SANITIZER=ASAN_UBSAN
  101. - CMAKE_FLAGS="$CMAKE_FLAGS -DPREFER_LUA=ON"
  102. - *common-job-env
  103. - name: gcc-coverage (gcc 9)
  104. os: linux
  105. compiler: gcc-9
  106. env:
  107. - GCOV=gcov-9
  108. - CMAKE_FLAGS="$CMAKE_FLAGS -DUSE_GCOV=ON"
  109. - GCOV_ERROR_FILE="/tmp/libgcov-errors.log"
  110. - USE_LUACOV=1
  111. - BUSTED_ARGS="--coverage"
  112. - *common-job-env
  113. addons:
  114. apt:
  115. sources:
  116. - sourceline: 'ppa:ubuntu-toolchain-r/test'
  117. - sourceline: 'deb [arch=amd64] https://packages.microsoft.com/ubuntu/16.04/prod xenial main'
  118. key_url: 'https://packages.microsoft.com/keys/microsoft.asc'
  119. packages:
  120. - *common-apt-packages
  121. - gcc-9
  122. - powershell
  123. - if: branch = master AND commit_message !~ /\[skip.lint\]/
  124. name: lint
  125. os: linux
  126. env:
  127. - CI_TARGET=lint
  128. - *common-job-env
  129. - stage: second stage
  130. name: "macOS: clang"
  131. os: osx
  132. compiler: clang
  133. osx_image: xcode10.2 # macOS 10.14
  134. env:
  135. - *common-job-env
  136. - name: gcc-functionaltest-lua
  137. os: linux
  138. compiler: gcc
  139. env:
  140. - FUNCTIONALTEST=functionaltest-lua
  141. - CMAKE_FLAGS="$CMAKE_FLAGS -DPREFER_LUA=ON"
  142. - DEPS_CMAKE_FLAGS="$DEPS_CMAKE_FLAGS -DUSE_BUNDLED_LUAJIT=OFF"
  143. - *common-job-env
  144. - name: gcc-32bit
  145. os: linux
  146. # Travis creates a cache per compiler. Set a different value here to
  147. # store 32-bit dependencies in a separate cache.
  148. compiler: gcc
  149. env:
  150. - BUILD_32BIT=ON
  151. - CMAKE_FLAGS="$CMAKE_FLAGS -m32 -DCMAKE_TOOLCHAIN_FILE=$TRAVIS_BUILD_DIR/cmake/i386-linux-gnu.toolchain.cmake"
  152. - DEPS_CMAKE_FLAGS="$DEPS_CMAKE_FLAGS -m32 -DCMAKE_TOOLCHAIN_FILE=$TRAVIS_BUILD_DIR/cmake/i386-linux-gnu.toolchain.cmake"
  153. # Minimum required CMake.
  154. - CMAKE_URL=https://cmake.org/files/v2.8/cmake-2.8.12-Linux-i386.sh
  155. - *common-job-env
  156. - name: clang-tsan
  157. os: linux
  158. compiler: clang
  159. env:
  160. - CLANG_SANITIZER=TSAN
  161. - *common-job-env
  162. - if: type != pull_request
  163. name: snap
  164. os: linux
  165. env:
  166. - LC_ALL: C.UTF-8
  167. - LANG: C.UTF-8
  168. - SNAPCRAFT_ENABLE_SILENT_REPORT: y
  169. - SNAPCRAFT_ENABLE_DEVELOPER_DEBUG: y
  170. addons:
  171. snaps:
  172. - name: snapcraft
  173. channel: stable
  174. classic: true
  175. - name: http
  176. - name: transfer
  177. - name: lxd
  178. channel: stable
  179. # Override default before_install, before_cache.
  180. before_install: /bin/true
  181. before_cache: /bin/true
  182. install: ci/snap/install.sh
  183. before_script: echo "Building snap..."
  184. script: ci/snap/script.sh
  185. after_success: ci/snap/after_success.sh
  186. deploy:
  187. skip_cleanup: true
  188. provider: script
  189. script: ci/snap/deploy.sh
  190. on:
  191. branch: master
  192. allow_failures:
  193. - env:
  194. - LC_ALL: C.UTF-8
  195. - LANG: C.UTF-8
  196. - SNAPCRAFT_ENABLE_SILENT_REPORT: y
  197. - SNAPCRAFT_ENABLE_DEVELOPER_DEBUG: y
  198. fast_finish: true
  199. before_install: ci/before_install.sh
  200. install: ci/install.sh
  201. before_script: ci/before_script.sh
  202. script: ci/script.sh
  203. before_cache: ci/before_cache.sh
  204. branches:
  205. only:
  206. - master
  207. - /^release-\d+\.\d+$/
  208. cache:
  209. apt: true
  210. ccache: true
  211. directories:
  212. - "$CACHE_NVIM_DEPS_DIR"
  213. git:
  214. quiet: true
  215. notifications:
  216. webhooks:
  217. urls:
  218. - https://webhooks.gitter.im/e/b5c38c99f9677aa3d031