robin/laufey

git clone https://git.robinwobin.dev/robin/laufey

dependabot[bot]ci: bump actions/checkout in the github-actions group across 1 directory20f44076dc

master
2.8 KiB92 linesraw
1name: build
2on:
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
15permissions:
16  contents: read
17
18concurrency:
19  group: ${{ github.workflow }}-${{ github.ref }}
20  cancel-in-progress: ${{ github.event_name == 'pull_request' }}
21
22env:
23  BIN_DIR: ${{ github.workspace }}/bin
24  INSTALL_PREFIX: ${{ github.workspace }}/nvim-install
25
26jobs:
27  # Test the minimum supported cmake.
28  old-cmake:
29    runs-on: ubuntu-latest
30    timeout-minutes: 15
31    env:
32      CMAKE_URL: 'https://cmake.org/files/v3.16/cmake-3.16.0-Linux-x86_64.sh'
33      CMAKE_VERSION: '3.16.0'
34    steps:
35      - uses: actions/checkout@v7.0.1
36        with:
37          persist-credentials: false
38
39      - uses: ./.github/actions/setup
40
41      - name: Install minimum required version of cmake
42        run: |
43          curl --retry 5 --silent --show-error --fail -o /tmp/cmake-installer.sh "$CMAKE_URL"
44          mkdir -p "$BIN_DIR" /opt/cmake-custom
45          chmod a+x /tmp/cmake-installer.sh
46          /tmp/cmake-installer.sh --prefix=/opt/cmake-custom --skip-license
47          ln -sfn /opt/cmake-custom/bin/cmake "$BIN_DIR/cmake"
48          cmake_version="$(cmake --version | head -1)"
49          echo "$cmake_version" | grep -qF "cmake version $CMAKE_VERSION" || {
50            echo "Unexpected CMake version: $cmake_version"
51            exit 1
52          }
53
54      - name: Build dependencies
55        run: make deps
56
57      - name: Build
58        run: make CMAKE_FLAGS="-D CI_BUILD=ON -D CMAKE_INSTALL_PREFIX:PATH=$INSTALL_PREFIX"
59
60      - name: Install
61        run: make install
62
63  # Offline build (USE_EXISTING_SRC_DIR=ON with no network access)
64  use-existing-src:
65    runs-on: ubuntu-latest
66    steps:
67      - uses: actions/checkout@v7.0.1
68        with:
69          persist-credentials: false
70
71      - uses: ./.github/actions/setup
72
73      - name: Build bundled dependencies
74        run: 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
78        run: |
79          rm -rf ./build
80          find .deps .deps/build -maxdepth 1 '!' \( -name .deps -o -name build -o -name src \) -exec rm -r '{}' +
81          cd .deps/build/src
82          rm -rf ./*-build
83          rm -rf ./*-stamp/*-{configure,build,install,done}
84          for 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
87        run: |
88          sudo sysctl kernel.apparmor_restrict_unprivileged_userns=0
89          unshare --map-root-user --net make deps DEPS_CMAKE_FLAGS=-DUSE_EXISTING_SRC_DIR=ON
90
91      - name: Build
92        run: make CMAKE_FLAGS="-D CI_BUILD=ON"