robin/laufey
git clone https://git.robinwobin.dev/robin/laufey
aa1d8a2702
master
1name : test 2on : 3push : 4branches : 5- 'master' 6- 'release-[0-9]+.[0-9]+' 7pull_request : 8branches : 9- 'master' 10- 'release-[0-9]+.[0-9]+' 11workflow_dispatch : 12 13permissions : 14contents : read 15 16concurrency : 17group : ${{ github.workflow }}-${{ github.ref }} 18cancel-in-progress : ${{ github.event_name == 'pull_request' }} 19 20env : 21ASAN_OPTIONS : detect_leaks=1:check_initialization_order=1:log_path=${{ github.workspace }}/build/log/asan:intercept_tls_get_addr=0 22BIN_DIR : ${{ github.workspace }}/bin 23BUILD_DIR : ${{ github.workspace }}/build 24INSTALL_PREFIX : ${{ github.workspace }}/nvim-install 25LOG_DIR : ${{ github.workspace }}/build/log 26NVIM_LOG_FILE : ${{ github.workspace }}/build/nvim.log 27TSAN_OPTIONS : log_path=${{ github.workspace }}/build/log/tsan 28VALGRIND_LOG : ${{ github.workspace }}/build/log/valgrind-%p.log 29# TEST_FILE: test/functional/core/startup_spec.lua 30# TEST_FILTER: foo 31 32jobs : 33lintc : 34runs-on : ubuntu-24.04 35timeout-minutes : 20 36env : 37NVIM_LOG_FILE : ${{ github.workspace }}/zig-out/nvim.log 38OPTS : -Doptimize=ReleaseFast -Dci-build 39steps : 40- uses : actions/checkout@v7.0.1 41with : 42persist-credentials : false 43 44- uses : ./.github/actions/setup 45 46- uses : mlugg/setup-zig@d1434d08867e3ee9daa34448df10607b98908d29 # v2.2.1 47with : 48version : 0.16.0 49- run : sudo apt-get install -y inotify-tools 50 51- name : nvim_bin 52id : nvim_bin 53run : zig build nvim_bin $OPTS 54 55- if : success() || failure() && steps.nvim_bin.outcome == 'success' 56name : clint.lua 57run : zig build lintc-clint $OPTS 58 59- if : success() || failure() && steps.nvim_bin.outcome == 'success' 60name : clang-tidy 61run : zig build lintc-clang-tidy $OPTS 62 63- if : success() || failure() && steps.nvim_bin.outcome == 'success' 64name : uncrustify 65run : zig build lintc-uncrustify $OPTS 66 67lint : 68runs-on : ubuntu-24.04-arm 69timeout-minutes : 10 70env : 71CC : clang 72steps : 73- uses : actions/checkout@v7.0.1 74with : 75persist-credentials : false 76 77- uses : ./.github/actions/setup 78 79- name : Install stylua 80run : | 81wget --directory-prefix="$BIN_DIR" https://github.com/JohnnyMorganz/StyLua/releases/latest/download/stylua-linux-aarch64.zip 82(cd "$BIN_DIR"; unzip stylua*.zip) 83 84- name : Install ts_query_ls 85run : | 86wget --directory-prefix="$BIN_DIR" https://github.com/ribru17/ts_query_ls/releases/latest/download/ts_query_ls-aarch64-unknown-linux-gnu.tar.gz 87(cd "$BIN_DIR"; tar -xzvf ts_query_ls-aarch64-unknown-linux-gnu.tar.gz) 88 89- name : Build third-party deps 90run : | 91cmake -S cmake.deps -B .deps -G Ninja 92cmake --build .deps 93 94- run : cmake -B build -G Ninja -D CI_LINT=ON 95 96- if : "!cancelled()" 97name : Determine if run should be aborted 98id : abort_job 99env : 100JOB_STATUS : ${{ job.status }} 101run : echo "status=${JOB_STATUS}" >> $GITHUB_OUTPUT 102 103- if : success() || failure() && steps.abort_job.outputs.status == 'success' 104name : stylua 105run : cmake --build build --target lintlua-stylua 106 107- if : success() || failure() && steps.abort_job.outputs.status == 'success' 108name : emmylua 109run : cmake --build build --target emmylua-check 110 111- if : success() || failure() && steps.abort_job.outputs.status == 'success' 112name : lintsh 113run : cmake --build build --target lintsh 114 115- if : success() || failure() && steps.abort_job.outputs.status == 'success' 116name : lintquery 117run : cmake --build build --target lintquery 118 119clang-analyzer : 120runs-on : ubuntu-24.04-arm 121timeout-minutes : 20 122env : 123CC : clang 124steps : 125- uses : actions/checkout@v7.0.1 126with : 127persist-credentials : false 128 129- uses : ./.github/actions/setup 130- name : Build third-party deps 131run : | 132cmake -S cmake.deps --preset ci 133cmake --build .deps 134cmake --preset ci 135- run : cmake --build build --target clang-analyzer 136 137posix : 138name : ${{ matrix.build.os }} ${{ matrix.build.flavor }} ${{ matrix.build.cc }} ${{ matrix.test }} 139strategy : 140fail-fast : false 141matrix : 142# The `os` field is not needed to differentiate between the different 143# matrix builds. It is needed to not change the required checks (which 144# uses jobs names) each time we bump the runner version. It may be 145# possible to remove if we e.g. start using `-latest` runner versions 146# or if github introduces a wildcard for required checks in the future. 147build : 148[ 149{ runner : ubuntu-24.04 , os : ubuntu , flavor : asan , cc : clang , flags : -D ENABLE_ASAN_UBSAN=ON }, 150{ runner : ubuntu-24.04 , os : ubuntu , flavor : tsan , cc : clang , flags : -D ENABLE_TSAN=ON }, 151{ runner : ubuntu-24.04 , os : ubuntu , flavor : release , cc : gcc , flags : -D CMAKE_BUILD_TYPE=Release -D ENABLE_TRANSLATIONS=ON }, 152{ runner : ubuntu-24.04-arm , os : ubuntu , flavor : arm , cc : clang , flags : -D CMAKE_BUILD_TYPE=RelWithDebInfo }, 153{ runner : macos-15-intel , os : macos , flavor : intel , cc : clang , flags : -D CMAKE_FIND_FRAMEWORK=NEVER , deps_flags : -D CMAKE_FIND_FRAMEWORK=NEVER }, 154{ runner : macos-26 , os : macos , flavor : arm , cc : clang , flags : -D CMAKE_FIND_FRAMEWORK=NEVER , deps_flags : -D CMAKE_FIND_FRAMEWORK=NEVER }, 155{ runner : ubuntu-24.04 , os : ubuntu , flavor : puc-lua , cc : gcc , deps_flags : -D USE_BUNDLED_LUAJIT=OFF -D USE_BUNDLED_LUA=ON , flags : -D PREFER_LUA=ON }, 156] 157test : [ unittest , functionaltest , oldtest ] 158exclude : 159- test : unittest 160build : { flavor : tsan } 161- test : unittest 162build : { flavor : puc-lua } 163- test : oldtest 164build : { flavor : tsan } 165- test : oldtest 166build : { runner : ubuntu-24.04-arm } 167runs-on : ${{ matrix.build.runner }} 168timeout-minutes : 45 169env : 170# The setup action adds this to PATH for neovim-ruby-host. 171BIN_DIR : ${{ github.workspace }}/.deps/bin 172CC : ${{ matrix.build.cc }} 173# Install and load Ruby gems from the dependency cache. 174GEM_HOME : ${{ github.workspace }}/.deps/ruby 175NVIM_TEST_INTEG : ${{ matrix.build.flavor == 'release' && '1' || '0' }} 176# Add cached provider dependencies to Perl's module search path. 177PERL5LIB : ${{ github.workspace }}/.deps/perl5/lib/perl5 178steps : 179- uses : actions/checkout@v7.0.1 180with : 181persist-credentials : false 182 183- uses : ./.github/actions/setup 184with : 185install_flags : "--test" 186 187- name : Create log dir 188run : mkdir -p "$LOG_DIR" 189 190- if : ${{ matrix.test != 'unittest' }} 191name : Set up interpreter packages 192run : | 193echo "Install neovim RubyGem." 194gem install --no-document --bindir "$BIN_DIR" --conservative --pre neovim 195 196cpanm -n -L .deps/perl5 --skip-satisfied Neovim::Ext || cat "$HOME/.cpanm/build.log" 197perl -W -e 'use Neovim::Ext; print $Neovim::Ext::VERSION' 198 199- name : List runtime files 200run : git -C runtime ls-files -z '*.vim' '*.ps' '*.dict' '*.py' '*.tutor' '*.awk' '*.sh' '*.bat' > "$RUNNER_TEMP/runtime-files" 201 202- name : Remove .git directory 203if : ${{ matrix.build.os == 'ubuntu' }} 204run : cmake -E rm -rf -- .git 205 206- name : Build third-party deps 207env : 208BUILD_DEPS_FLAGS : ${{ matrix.build.deps_flags }} 209run : | 210cmake -S cmake.deps --preset ci -D CMAKE_BUILD_TYPE=Debug $BUILD_DEPS_FLAGS 211cmake --build .deps 212 213- name : Build 214env : 215BUILD_FLAGS : ${{ matrix.build.flags }} 216run : | 217cmake --preset ci -D CMAKE_BUILD_TYPE=Debug -D CMAKE_INSTALL_PREFIX:PATH=$INSTALL_PREFIX $BUILD_FLAGS 218cmake --build build 219 220- if : ${{ matrix.test == 'unittest' }} 221name : unittest 222timeout-minutes : 20 223run : cmake --build build --target unittest 224 225- if : ${{ matrix.test == 'functionaltest' }} 226name : functionaltest 227timeout-minutes : 20 228env : 229# With parallel tests, use shorter timeout for a single group. 230TEST_TIMEOUT : 600 231run : | 232set +e 233# `-k 0` tells ninja to continue running all targets even if some fail. 234cmake --build build --target functionaltest-parallel -j 2 -- -k 0 235exit_code="$?" 236cmake --build build --target functionaltest-summary 237exit "$exit_code" 238 239- if : ${{ matrix.test == 'oldtest' }} 240name : oldtest 241timeout-minutes : 20 242run : make -C test/old/testdir NVIM_PRG=$(realpath build)/bin/nvim 243 244- name : Install 245run : | 246cmake --install build 247"$INSTALL_PREFIX/bin/nvim" -V1 --version 248if ! "$INSTALL_PREFIX/bin/nvim" -u NONE -e -c ':help' -c ':qall'; then 249echo "Running ':help' in the installed nvim failed." 250echo "Maybe the helptags have not been generated properly." 251echo 'Failed running :help' 252exit 1 253fi 254 255# Check that all runtime files were installed 256while IFS= read -r -d '' file; do 257if ! test -e "$INSTALL_PREFIX/share/nvim/runtime/$file"; then 258printf "It appears that %s is not installed." "$file" 259exit 1 260fi 261done < "$RUNNER_TEMP/runtime-files" 262 263# Check that generated syntax file has function names, #5060. 264genvimsynf=syntax/vim/generated.vim 265gpat='syn keyword vimFuncName .*eval' 266if ! grep -q "$gpat" "$INSTALL_PREFIX/share/nvim/runtime/$genvimsynf"; then 267echo "It appears that $genvimsynf does not contain $gpat." 268exit 1 269fi 270 271- if : '!cancelled()' 272name : Show logs 273run : cat $(find "$LOG_DIR" -type f) 274 275# TODO: matrixify 276zig-build-linux : 277runs-on : ubuntu-24.04 278timeout-minutes : 45 279name : build using zig build (linux) 280env : 281# NB: tests assume there is a chosen install path, but nothing needs to be actually installed 282OPTS : -Doptimize=ReleaseSafe -Dinstall-path=/usr/ 283steps : 284- uses : actions/checkout@v7.0.1 285with : 286persist-credentials : false 287 288- uses : mlugg/setup-zig@d1434d08867e3ee9daa34448df10607b98908d29 # v2.2.1 289with : 290version : 0.16.0 291- run : sudo apt-get install -y inotify-tools 292 293- run : zig fmt --check . # run first, otherwise it will descend into zig-pkg.. 294- run : mkdir -p build/ # build/ is used for shared log paths, see global ENV defs 295- run : zig build $OPTS test_nlua0 296- run : zig build $OPTS nvim_bin && ./zig-out/bin/nvim --version 297- run : zig build $OPTS unittest 298- run : zig build $OPTS functionaltest 299- run : zig build $OPTS oldtest 300# `zig build` uses a lua script for doctags in order to support cross-compiling 301# compare with the builtin generator that they match 302- run : cd runtime; ../zig-out/bin/nvim -u NONE -i NONE -e --headless -c "helptags ++t doc" -c quit 303- run : diff -u runtime/doc/tags zig-out/runtime/doc/tags 304 305zig-build-macos-15 : 306runs-on : macos-15 307timeout-minutes : 45 308name : build using zig build (macos 15) 309env : 310OPTS : -Dinstall-path=/usr/ 311steps : 312- uses : actions/checkout@v7.0.1 313with : 314persist-credentials : false 315 316- uses : mlugg/setup-zig@d1434d08867e3ee9daa34448df10607b98908d29 # v2.2.1 317with : 318version : 0.16.0 319 320- run : mkdir -p build/ # build/ is used for shared log paths, see global ENV defs 321- run : zig build $OPTS test_nlua0 322- run : zig build $OPTS nvim_bin && ./zig-out/bin/nvim --version 323- run : zig build $OPTS functionaltest 324- run : zig build $OPTS oldtest 325 326zig-build-windows : 327runs-on : windows-2025 328timeout-minutes : 45 329name : build using zig build (windows) 330steps : 331- uses : actions/checkout@v7.0.1 332with : 333persist-credentials : false 334 335- uses : mlugg/setup-zig@d1434d08867e3ee9daa34448df10607b98908d29 # v2.2.1 336with : 337version : 0.16.0 338 339- run : mkdir -p build/ # build/ is used for shared log paths, see global ENV defs 340- run : zig build test_nlua0 341- run : zig build nvim_bin 342- run : ./zig-out/bin/nvim --version 343# TODO: support entire test suite 344- run : zig build functionaltest -- test/functional/api/buffer_spec.lua 345 346windows : 347uses : ./.github/workflows/test_windows.yml 348 349with-external-deps : 350runs-on : ubuntu-24.04-arm 351timeout-minutes : 10 352env : 353CC : gcc 354steps : 355- uses : actions/checkout@v7.0.1 356with : 357persist-credentials : false 358 359- uses : ./.github/actions/setup 360 361- name : Install dependencies 362run : | 363sudo apt-get install -y \ 364libluajit-5.1-dev \ 365libunibilium-dev \ 366libuv1-dev \ 367lua-filesystem \ 368lua-lpeg \ 369luajit \ 370lua-luv-dev 371# libtree-sitter-dev \ 372 373# Remove comments from packages once we start using these external 374# dependencies. 375 376- name : Build third-party deps 377run : | 378cmake -S cmake.deps --preset external_deps 379cmake --build .deps 380 381- name : Build 382run : | 383 cmake --preset ci 384 cmake --build build