mirror of
https://github.com/neovim/neovim.git
synced 2024-12-20 03:05:11 -07:00
9301abdf74
Having to specify CI_BUILD for every CI job requires boilerplate. More
importantly, it's easy to forget to enable CI_BUILD, as seen by
8a20f9f98a
. It's simpler to remember to
turn CI_BUILD off when a job errors instead of remembering that every
new job should have CI_BUILD on.
140 lines
3.9 KiB
YAML
140 lines
3.9 KiB
YAML
name: build
|
|
on:
|
|
pull_request:
|
|
branches:
|
|
- 'master'
|
|
- 'release-[0-9]+.[0-9]+'
|
|
paths:
|
|
- '**.cmake'
|
|
- '**/CMakeLists.txt'
|
|
- '**/CMakePresets.json'
|
|
- 'cmake.*/**'
|
|
- '.github/**'
|
|
|
|
concurrency:
|
|
group: ${{ github.workflow }}-${{ github.head_ref }}
|
|
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:
|
|
- uses: actions/checkout@v3
|
|
|
|
- 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:
|
|
- uses: actions/checkout@v3
|
|
|
|
- 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
|
|
run: make CMAKE_FLAGS="-D CMAKE_INSTALL_PREFIX:PATH=$INSTALL_PREFIX"
|
|
|
|
- name: Install
|
|
run: make install
|
|
|
|
with-external-deps:
|
|
runs-on: ubuntu-22.04
|
|
timeout-minutes: 10
|
|
steps:
|
|
- uses: actions/checkout@v3
|
|
|
|
- name: Install dependencies
|
|
run: |
|
|
sudo add-apt-repository ppa:neovim-ppa/stable
|
|
./.github/scripts/install_deps.sh
|
|
sudo apt-get install -y \
|
|
libluajit-5.1-dev \
|
|
libmsgpack-dev \
|
|
libtermkey-dev \
|
|
libtree-sitter-dev \
|
|
libunibilium-dev \
|
|
libuv1-dev \
|
|
lua-busted \
|
|
lua-filesystem \
|
|
lua-inspect \
|
|
lua-lpeg \
|
|
lua-nvim \
|
|
luajit
|
|
# libvterm-dev \
|
|
# lua-luv-dev
|
|
|
|
# Remove comments from packages once we start using these external
|
|
# dependencies.
|
|
|
|
- name: Build third-party deps
|
|
run: |
|
|
# Ideally all dependencies should external for this job, but some
|
|
# dependencies don't have the required version available. We use the
|
|
# bundled versions for these with the hopes of being able to remove them
|
|
# later on.
|
|
cmake -S cmake.deps -B .deps -G Ninja -D USE_BUNDLED=OFF -D USE_BUNDLED_LUV=ON -D USE_BUNDLED_LIBVTERM=ON
|
|
cmake --build .deps
|
|
|
|
- name: Build
|
|
run: |
|
|
cmake -B build -G Ninja
|
|
cmake --build build
|
|
|
|
multi-config:
|
|
runs-on: ubuntu-22.04
|
|
timeout-minutes: 10
|
|
steps:
|
|
- uses: actions/checkout@v3
|
|
|
|
- name: Install dependencies
|
|
run: ./.github/scripts/install_deps.sh
|
|
|
|
- name: Build third-party deps
|
|
run: |
|
|
cmake -S cmake.deps -B .deps -G "Ninja Multi-Config"
|
|
cmake --build .deps
|
|
|
|
- name: Configure
|
|
run: cmake -B build -G Ninja -D CMAKE_C_COMPILER=gcc
|
|
|
|
- name: Release
|
|
run: cmake --build build --config Release
|
|
|
|
- name: MinSizeRel
|
|
run: cmake --build build --config MinSizeRel
|