build.yml 3.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798
  1. name: build
  2. on:
  3. pull_request:
  4. branches:
  5. - 'master'
  6. - 'release-[0-9]+.[0-9]+'
  7. paths:
  8. - '**.cmake'
  9. - '**/CMakeLists.txt'
  10. - '**/CMakePresets.json'
  11. - 'cmake.*/**'
  12. - '.github/**'
  13. workflow_dispatch:
  14. concurrency:
  15. group: ${{ github.workflow }}-${{ github.ref }}
  16. cancel-in-progress: ${{ github.event_name == 'pull_request' }}
  17. env:
  18. BIN_DIR: ${{ github.workspace }}/bin
  19. INSTALL_PREFIX: ${{ github.workspace }}/nvim-install
  20. jobs:
  21. wasmtime:
  22. strategy:
  23. fail-fast: false
  24. matrix:
  25. test: [ubuntu-latest, macos-latest, windows-latest]
  26. runs-on: ${{ matrix.test }}
  27. steps:
  28. - uses: actions/checkout@v4
  29. - uses: ./.github/actions/setup
  30. - run: |
  31. cmake -S cmake.deps --preset ci -D ENABLE_WASMTIME=ON
  32. cmake --build .deps
  33. cmake --preset ci -D ENABLE_WASMTIME=ON
  34. cmake --build build
  35. old-cmake:
  36. name: Test oldest supported cmake
  37. runs-on: ubuntu-latest
  38. timeout-minutes: 15
  39. env:
  40. CMAKE_URL: 'https://cmake.org/files/v3.16/cmake-3.16.0-Linux-x86_64.sh'
  41. CMAKE_VERSION: '3.16.0'
  42. steps:
  43. - uses: actions/checkout@v4
  44. - uses: ./.github/actions/setup
  45. - name: Install minimum required version of cmake
  46. run: |
  47. curl --retry 5 --silent --show-error --fail -o /tmp/cmake-installer.sh "$CMAKE_URL"
  48. mkdir -p "$BIN_DIR" /opt/cmake-custom
  49. chmod a+x /tmp/cmake-installer.sh
  50. /tmp/cmake-installer.sh --prefix=/opt/cmake-custom --skip-license
  51. ln -sfn /opt/cmake-custom/bin/cmake "$BIN_DIR/cmake"
  52. cmake_version="$(cmake --version | head -1)"
  53. echo "$cmake_version" | grep -qF "cmake version $CMAKE_VERSION" || {
  54. echo "Unexpected CMake version: $cmake_version"
  55. exit 1
  56. }
  57. - name: Build dependencies
  58. run: make deps
  59. - name: Build
  60. run: make CMAKE_FLAGS="-D CI_BUILD=ON -D CMAKE_INSTALL_PREFIX:PATH=$INSTALL_PREFIX"
  61. - name: Install
  62. run: make install
  63. use-existing-src:
  64. name: Test USE_EXISTING_SRC_DIR=ON builds with no network access
  65. runs-on: ubuntu-latest
  66. steps:
  67. - uses: actions/checkout@v4
  68. - uses: ./.github/actions/setup
  69. - name: Build bundled dependencies
  70. run: make deps
  71. - name: Clean bundled dependencies à la neovim/deps
  72. run: |
  73. rm -rf ./build
  74. find .deps .deps/build -maxdepth 1 '!' \( -name .deps -o -name build -o -name src \) -exec rm -r '{}' +
  75. cd .deps/build/src
  76. rm -rf ./*-build
  77. rm -rf ./*-stamp/*-{configure,build,install,done}
  78. for d in *; do (cd "$d"; rm -rf ./autom4te.cache; make clean || true; make distclean || true); done
  79. - name: Re-build bundled dependencies with no network access
  80. run: |
  81. sudo sysctl kernel.apparmor_restrict_unprivileged_userns=0
  82. unshare --map-root-user --net make deps DEPS_CMAKE_FLAGS=-DUSE_EXISTING_SRC_DIR=ON
  83. - name: Build
  84. run: make CMAKE_FLAGS="-D CI_BUILD=ON"