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