ci.yml 7.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250
  1. name: CI
  2. on:
  3. push:
  4. branches:
  5. - 'master'
  6. - 'release-[0-9]+.[0-9]+'
  7. pull_request:
  8. types: [opened, synchronize, reopened, ready_for_review]
  9. branches:
  10. - 'master'
  11. - 'release-[0-9]+.[0-9]+'
  12. paths-ignore:
  13. - 'runtime/doc/*'
  14. # Cancel any in-progress CI runs for a PR if it is updated
  15. concurrency:
  16. group: ${{ github.workflow }}-${{ github.event_name == 'pull_request' && github.head_ref || github.sha }}
  17. cancel-in-progress: true
  18. jobs:
  19. lint:
  20. # This job tests two things: it lints the code but also builds neovim using
  21. # system dependencies instead of bundled dependencies. This is to make sure
  22. # we are able to build neovim without pigeonholing ourselves into specifics
  23. # of the bundled dependencies.
  24. if: (github.event_name == 'pull_request' && github.base_ref == 'master' && !github.event.pull_request.draft) || (github.event_name == 'push' && github.ref == 'refs/heads/master')
  25. runs-on: ubuntu-20.04
  26. timeout-minutes: 10
  27. env:
  28. CC: gcc
  29. steps:
  30. - uses: actions/checkout@v2
  31. - name: Setup common environment variables
  32. run: ./.github/workflows/env.sh lint
  33. - name: Install apt packages
  34. run: |
  35. sudo add-apt-repository ppa:neovim-ppa/stable
  36. sudo apt-get update
  37. sudo apt-get install -y \
  38. autoconf \
  39. automake \
  40. build-essential \
  41. ccache \
  42. cmake \
  43. flake8 \
  44. gettext \
  45. gperf \
  46. libluajit-5.1-dev \
  47. libmsgpack-dev \
  48. libtermkey-dev \
  49. libtool-bin \
  50. libtree-sitter-dev \
  51. libunibilium-dev \
  52. libuv1-dev \
  53. libvterm-dev \
  54. locales \
  55. lua-busted \
  56. lua-check \
  57. lua-filesystem \
  58. lua-inspect \
  59. lua-lpeg \
  60. lua-luv-dev \
  61. lua-nvim \
  62. luajit \
  63. ninja-build \
  64. pkg-config
  65. - name: Cache artifacts
  66. uses: actions/cache@v2
  67. with:
  68. path: |
  69. ${{ env.CACHE_NVIM_DEPS_DIR }}
  70. ~/.ccache
  71. key: lint-${{ hashFiles('cmake/*', '**/CMakeLists.txt', '!third-party/**CMakeLists.txt') }}-${{ github.base_ref }}
  72. - name: Build third-party
  73. run: ./ci/before_script.sh
  74. - name: Build nvim
  75. run: ./ci/run_tests.sh build_nvim
  76. - if: "!cancelled()"
  77. name: clint-full
  78. run: ./ci/run_lint.sh clint-full
  79. - if: "!cancelled()"
  80. name: lualint
  81. run: ./ci/run_lint.sh lualint
  82. - if: "!cancelled()"
  83. name: pylint
  84. run: ./ci/run_lint.sh pylint
  85. - if: "!cancelled()"
  86. name: shlint
  87. run: ./ci/run_lint.sh shlint
  88. - if: "!cancelled()"
  89. name: check-single-includes
  90. run: ./ci/run_lint.sh check-single-includes
  91. - name: Cache dependencies
  92. run: ./ci/before_cache.sh
  93. posix:
  94. name: ${{ matrix.runner }} ${{ matrix.flavor }} (cc=${{ matrix.cc }})
  95. strategy:
  96. fail-fast: false
  97. matrix:
  98. include:
  99. - flavor: asan
  100. cc: clang-13
  101. runner: ubuntu-20.04
  102. os: linux
  103. - flavor: tsan
  104. cc: clang-13
  105. runner: ubuntu-20.04
  106. os: linux
  107. - cc: clang
  108. runner: macos-10.15
  109. os: osx
  110. - cc: clang
  111. runner: macos-11.0
  112. os: osx
  113. # The functionaltest-lua test two things simultaneously:
  114. # 1. Check that the tests pass with PUC Lua instead of LuaJIT.
  115. # 2. Use as oldest/minimum versions of dependencies/build tools we
  116. # still explicitly support so we don't accidentally rely on
  117. # features that is only available on later versions.
  118. - flavor: functionaltest-lua
  119. cc: gcc
  120. runner: ubuntu-20.04
  121. os: linux
  122. cmake: minimum_required
  123. runs-on: ${{ matrix.runner }}
  124. timeout-minutes: 45
  125. if: github.event.pull_request.draft == false
  126. env:
  127. CC: ${{ matrix.cc }}
  128. CI_OS_NAME: ${{ matrix.os }}
  129. steps:
  130. - uses: actions/checkout@v2
  131. - name: Setup common environment variables
  132. run: ./.github/workflows/env.sh ${{ matrix.flavor }}
  133. - name: Install apt packages
  134. if: matrix.os == 'linux'
  135. run: |
  136. sudo apt-get update
  137. sudo apt-get install -y autoconf automake build-essential ccache cmake cpanminus cscope gcc-multilib gdb gettext gperf language-pack-tr libtool-bin locales ninja-build pkg-config python3 python3-pip python3-setuptools unzip valgrind xclip
  138. - name: Install minimum required version of cmake
  139. if: matrix.cmake == 'minimum_required'
  140. env:
  141. CMAKE_URL: 'https://cmake.org/files/v3.10/cmake-3.10.0-Linux-x86_64.sh'
  142. CMAKE_VERSION: '3.10.0'
  143. shell: bash
  144. run: |
  145. curl --retry 5 --silent --show-error --fail -o /tmp/cmake-installer.sh "$CMAKE_URL"
  146. mkdir -p "$HOME/.local/bin" /opt/cmake-custom
  147. chmod a+x /tmp/cmake-installer.sh
  148. /tmp/cmake-installer.sh --prefix=/opt/cmake-custom --skip-license
  149. ln -sfn /opt/cmake-custom/bin/cmake "$HOME/.local/bin/cmake"
  150. cmake_version="$(cmake --version | head -1)"
  151. echo "$cmake_version" | grep -qF "cmake version $CMAKE_VERSION" || {
  152. echo "Unexpected CMake version: $cmake_version"
  153. exit 1
  154. }
  155. - name: Install new clang
  156. if: matrix.flavor == 'asan' || matrix.flavor == 'tsan'
  157. run: |
  158. wget https://apt.llvm.org/llvm.sh
  159. chmod a+x llvm.sh
  160. sudo ./llvm.sh 13
  161. rm llvm.sh
  162. - name: Install brew packages
  163. if: matrix.os == 'osx'
  164. run: |
  165. brew update --quiet
  166. brew install automake ccache cpanminus ninja
  167. - name: Setup interpreter packages
  168. run: ./ci/install.sh
  169. - name: Cache dependencies
  170. uses: actions/cache@v2
  171. with:
  172. path: |
  173. ${{ env.CACHE_NVIM_DEPS_DIR }}
  174. ~/.ccache
  175. key: ${{ matrix.runner }}-${{ matrix.flavor }}-${{ matrix.cc }}-${{ hashFiles('cmake/*', 'third-party/**', '**/CMakeLists.txt') }}-${{ github.base_ref }}
  176. - name: Build third-party
  177. run: ./ci/before_script.sh
  178. - name: Build
  179. run: ./ci/run_tests.sh build_nvim
  180. - if: matrix.flavor != 'tsan' && matrix.flavor != 'functionaltest-lua' && !cancelled()
  181. name: Unittests
  182. run: ./ci/run_tests.sh unittests
  183. - if: matrix.flavor != 'tsan' && !cancelled()
  184. name: Functionaltests
  185. run: ./ci/run_tests.sh functionaltests
  186. - if: "!cancelled()"
  187. name: Oldtests
  188. run: ./ci/run_tests.sh oldtests
  189. - if: "!cancelled()"
  190. name: Install nvim
  191. run: ./ci/run_tests.sh install_nvim
  192. - name: Cache dependencies
  193. run: ./ci/before_cache.sh
  194. windows:
  195. runs-on: windows-2019
  196. timeout-minutes: 45
  197. if: github.event.pull_request.draft == false
  198. env:
  199. DEPS_BUILD_DIR: ${{ format('{0}/nvim-deps', github.workspace) }}
  200. DEPS_PREFIX: ${{ format('{0}/nvim-deps/usr', github.workspace) }}
  201. strategy:
  202. fail-fast: false
  203. matrix:
  204. config: [ MINGW_64-gcov, MSVC_64 ]
  205. name: windows (${{ matrix.config }})
  206. steps:
  207. - uses: actions/checkout@v2
  208. - uses: actions/cache@v2
  209. with:
  210. path: ${{ env.DEPS_BUILD_DIR }}
  211. key: ${{ matrix.config }}-${{ hashFiles('third-party\**') }}
  212. - name: Run CI
  213. run: powershell ci\build.ps1
  214. env:
  215. CONFIGURATION: ${{ matrix.config }}