2023-02-18 02:47:22 -07:00
|
|
|
name: build
|
|
|
|
on:
|
|
|
|
pull_request:
|
|
|
|
branches:
|
|
|
|
- 'master'
|
|
|
|
- 'release-[0-9]+.[0-9]+'
|
|
|
|
paths:
|
|
|
|
- '**.cmake'
|
|
|
|
- '**/CMakeLists.txt'
|
|
|
|
- '**/CMakePresets.json'
|
|
|
|
- 'cmake.*/**'
|
|
|
|
- '.github/**'
|
|
|
|
|
|
|
|
concurrency:
|
2023-09-09 04:37:32 -07:00
|
|
|
group: ${{ github.workflow }}-${{ github.head_ref }}
|
2023-02-18 02:47:22 -07:00
|
|
|
cancel-in-progress: true
|
|
|
|
|
|
|
|
env:
|
|
|
|
BIN_DIR: ${{ github.workspace }}/bin
|
|
|
|
INSTALL_PREFIX: ${{ github.workspace }}/nvim-install
|
|
|
|
|
|
|
|
jobs:
|
|
|
|
macos-universal:
|
|
|
|
runs-on: macos-latest
|
|
|
|
timeout-minutes: 20
|
|
|
|
steps:
|
2023-09-04 05:51:40 -07:00
|
|
|
- uses: actions/checkout@v4
|
2023-02-18 02:47:22 -07:00
|
|
|
|
|
|
|
- name: Install dependencies
|
|
|
|
run: ./.github/scripts/install_deps.sh
|
|
|
|
|
|
|
|
- run: printf 'NVIM_BUILD_TYPE=Release\n' >> $GITHUB_ENV
|
|
|
|
|
|
|
|
- name: Build universal binary
|
|
|
|
run: ./.github/scripts/build_universal_macos.sh
|
|
|
|
|
|
|
|
old-cmake:
|
|
|
|
name: Test oldest supported cmake
|
|
|
|
runs-on: ubuntu-22.04
|
|
|
|
timeout-minutes: 15
|
|
|
|
env:
|
|
|
|
CMAKE_URL: 'https://cmake.org/files/v3.10/cmake-3.10.0-Linux-x86_64.sh'
|
|
|
|
CMAKE_VERSION: '3.10.0'
|
|
|
|
steps:
|
2023-09-04 05:51:40 -07:00
|
|
|
- uses: actions/checkout@v4
|
2023-02-18 02:47:22 -07:00
|
|
|
|
|
|
|
- name: Set up environment
|
|
|
|
run: echo "$BIN_DIR" >> $GITHUB_PATH
|
|
|
|
|
|
|
|
- name: Install dependencies
|
|
|
|
run: ./.github/scripts/install_deps.sh
|
|
|
|
|
|
|
|
- name: Install minimum required version of cmake
|
|
|
|
run: |
|
|
|
|
curl --retry 5 --silent --show-error --fail -o /tmp/cmake-installer.sh "$CMAKE_URL"
|
|
|
|
mkdir -p "$BIN_DIR" /opt/cmake-custom
|
|
|
|
chmod a+x /tmp/cmake-installer.sh
|
|
|
|
/tmp/cmake-installer.sh --prefix=/opt/cmake-custom --skip-license
|
|
|
|
ln -sfn /opt/cmake-custom/bin/cmake "$BIN_DIR/cmake"
|
|
|
|
cmake_version="$(cmake --version | head -1)"
|
|
|
|
echo "$cmake_version" | grep -qF "cmake version $CMAKE_VERSION" || {
|
|
|
|
echo "Unexpected CMake version: $cmake_version"
|
|
|
|
exit 1
|
|
|
|
}
|
|
|
|
|
|
|
|
- name: Build dependencies
|
|
|
|
run: make deps
|
|
|
|
|
|
|
|
- name: Build
|
2023-04-07 13:31:04 -07:00
|
|
|
run: make CMAKE_FLAGS="-D CI_BUILD=ON -D CMAKE_INSTALL_PREFIX:PATH=$INSTALL_PREFIX"
|
2023-02-18 02:47:22 -07:00
|
|
|
|
|
|
|
- name: Install
|
|
|
|
run: make install
|
2023-05-22 05:45:11 -07:00
|
|
|
|
|
|
|
use-existing-src:
|
|
|
|
name: Test USE_EXISTING_SRC_DIR=ON builds with no network access
|
|
|
|
runs-on: ubuntu-22.04
|
|
|
|
steps:
|
2023-09-04 05:51:40 -07:00
|
|
|
- uses: actions/checkout@v4
|
2023-05-22 05:45:11 -07:00
|
|
|
|
|
|
|
- name: Install build dependencies
|
|
|
|
run: ./.github/scripts/install_deps.sh
|
|
|
|
|
|
|
|
- name: Build bundled dependencies
|
|
|
|
run: make deps
|
|
|
|
|
|
|
|
- name: Clean bundled dependencies à la neovim/deps
|
|
|
|
run: |
|
|
|
|
rm -rf ./build
|
|
|
|
find .deps .deps/build -maxdepth 1 '!' \( -name .deps -o -name build -o -name src \) -exec rm -r '{}' +
|
|
|
|
cd .deps/build/src
|
|
|
|
rm -rf ./*-build
|
|
|
|
rm -rf ./*-stamp/*-{configure,build,install,done}
|
|
|
|
for d in *; do (cd "$d"; rm -rf ./autom4te.cache; make clean || true; make distclean || true); done
|
|
|
|
|
|
|
|
- name: Re-build bundled dependencies with no network access
|
|
|
|
run: unshare --map-root-user --net make deps DEPS_CMAKE_FLAGS=-DUSE_EXISTING_SRC_DIR=ON
|
|
|
|
|
|
|
|
- name: Build
|
|
|
|
run: make CMAKE_FLAGS="-D CI_BUILD=ON"
|