.travis.yml 4.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174
  1. dist: xenial
  2. language: c
  3. env:
  4. global:
  5. # Set "false" to force rebuild of third-party dependencies.
  6. - CACHE_ENABLE=true
  7. # Build directory for Neovim.
  8. - BUILD_DIR="$TRAVIS_BUILD_DIR/build"
  9. # Build directory for third-party dependencies.
  10. - DEPS_BUILD_DIR="$HOME/nvim-deps"
  11. # Install directory for Neovim.
  12. - INSTALL_PREFIX="$HOME/nvim-install"
  13. # Log directory for Clang sanitizers and Valgrind.
  14. - LOG_DIR="$BUILD_DIR/log"
  15. # Nvim log file.
  16. - NVIM_LOG_FILE="$BUILD_DIR/.nvimlog"
  17. # Default CMake flags.
  18. - CMAKE_FLAGS="-DTRAVIS_CI_BUILD=ON
  19. -DCMAKE_BUILD_TYPE=Debug
  20. -DCMAKE_INSTALL_PREFIX:PATH=$INSTALL_PREFIX
  21. -DBUSTED_OUTPUT_TYPE=nvim
  22. -DDEPS_PREFIX=$DEPS_BUILD_DIR/usr
  23. -DMIN_LOG_LEVEL=3"
  24. - DEPS_CMAKE_FLAGS="-DUSE_BUNDLED_GPERF=OFF"
  25. # Additional CMake flags for 32-bit builds.
  26. - CMAKE_FLAGS_32BIT="-DCMAKE_SYSTEM_LIBRARY_PATH=/lib32:/usr/lib32:/usr/local/lib32
  27. -DCMAKE_IGNORE_PATH=/lib:/usr/lib:/usr/local/lib
  28. -DCMAKE_TOOLCHAIN_FILE=$TRAVIS_BUILD_DIR/cmake/i386-linux-gnu.toolchain.cmake"
  29. # Environment variables for Clang sanitizers.
  30. - ASAN_OPTIONS="detect_leaks=1:check_initialization_order=1:log_path=$LOG_DIR/asan"
  31. - TSAN_OPTIONS="log_path=$LOG_DIR/tsan"
  32. - UBSAN_OPTIONS="print_stacktrace=1 log_path=$LOG_DIR/ubsan"
  33. # Environment variables for Valgrind.
  34. - VALGRIND_LOG="$LOG_DIR/valgrind-%p.log"
  35. - CACHE_NVIM_DEPS_DIR="$HOME/.cache/nvim-deps"
  36. # If this file exists, the cache is valid (compile was successful).
  37. - CACHE_MARKER="$CACHE_NVIM_DEPS_DIR/.travis_cache_marker"
  38. # default target name for functional tests
  39. - FUNCTIONALTEST=functionaltest
  40. - CI_TARGET=tests
  41. # Environment variables for ccache
  42. - CCACHE_COMPRESS=1
  43. - CCACHE_SLOPPINESS=time_macros,file_macro
  44. - CCACHE_BASEDIR="$TRAVIS_BUILD_DIR"
  45. # Default since 3.3, but Travis (Xenial) has 3.2.4; required with newer gcc/clang.
  46. - CCACHE_CPP2=1
  47. anchors:
  48. envs: &common-job-env
  49. # Do not fall back to cache for "master" for PR on "release" branch:
  50. # adds the target branch to the cache key.
  51. FOR_TRAVIS_CACHE=v1-$TRAVIS_BRANCH
  52. addons:
  53. apt:
  54. packages: &common-apt-packages
  55. - apport
  56. - autoconf
  57. - automake
  58. - build-essential
  59. - clang
  60. - cmake
  61. - cscope
  62. - gcc-multilib
  63. - gdb
  64. - gperf
  65. - language-pack-tr
  66. - libc6-dev-i386
  67. - libtool-bin
  68. - locales
  69. - ninja-build
  70. - pkg-config
  71. - unzip
  72. - valgrind
  73. - xclip
  74. homebrew:
  75. update: true
  76. packages:
  77. - ccache
  78. - ninja
  79. jobs:
  80. include:
  81. - stage: baseline
  82. name: clang-asan
  83. os: linux
  84. compiler: clang
  85. # Use Lua so that ASAN can test our embedded Lua support. 8fec4d53d0f6
  86. env:
  87. - CLANG_SANITIZER=ASAN_UBSAN
  88. - CMAKE_FLAGS="$CMAKE_FLAGS -DPREFER_LUA=ON"
  89. - *common-job-env
  90. - name: gcc-coverage (gcc 9)
  91. os: linux
  92. compiler: gcc-9
  93. env:
  94. - GCOV=gcov-9
  95. - CMAKE_FLAGS="$CMAKE_FLAGS -DUSE_GCOV=ON"
  96. - GCOV_ERROR_FILE="/tmp/libgcov-errors.log"
  97. - *common-job-env
  98. addons:
  99. apt:
  100. sources:
  101. - sourceline: 'ppa:ubuntu-toolchain-r/test'
  102. packages:
  103. - *common-apt-packages
  104. - gcc-9
  105. - if: branch = master AND commit_message !~ /\[skip.lint\]/
  106. name: lint
  107. os: linux
  108. env:
  109. - CI_TARGET=lint
  110. - *common-job-env
  111. - stage: second stage
  112. name: "macOS: clang"
  113. os: osx
  114. compiler: clang
  115. osx_image: xcode10.2 # macOS 10.14
  116. env:
  117. - *common-job-env
  118. - name: gcc-functionaltest-lua
  119. os: linux
  120. compiler: gcc
  121. env:
  122. - FUNCTIONALTEST=functionaltest-lua
  123. - CMAKE_FLAGS="$CMAKE_FLAGS -DPREFER_LUA=ON"
  124. - DEPS_CMAKE_FLAGS="$DEPS_CMAKE_FLAGS -DUSE_BUNDLED_LUAJIT=OFF"
  125. - *common-job-env
  126. - name: gcc-32bit
  127. os: linux
  128. # Travis creates a cache per compiler. Set a different value here to
  129. # store 32-bit dependencies in a separate cache.
  130. compiler: gcc
  131. env:
  132. - BUILD_32BIT=ON
  133. # Minimum required CMake.
  134. - CMAKE_URL=https://cmake.org/files/v2.8/cmake-2.8.12-Linux-i386.sh
  135. - *common-job-env
  136. - name: clang-tsan
  137. os: linux
  138. compiler: clang
  139. env:
  140. - CLANG_SANITIZER=TSAN
  141. - *common-job-env
  142. fast_finish: true
  143. before_install: ci/before_install.sh
  144. install: ci/install.sh
  145. before_script: ci/before_script.sh
  146. script: ci/script.sh
  147. before_cache: ci/before_cache.sh
  148. branches:
  149. only:
  150. - master
  151. - /^release-\d+\.\d+$/
  152. cache:
  153. apt: true
  154. ccache: true
  155. directories:
  156. - "$CACHE_NVIM_DEPS_DIR"
  157. git:
  158. quiet: true
  159. notifications:
  160. webhooks:
  161. urls:
  162. - https://webhooks.gitter.im/e/b5c38c99f9677aa3d031