diff --git a/.gitea/workflows/ci.yaml b/.gitea/workflows/ci.yaml index 02d3f94..62466b7 100644 --- a/.gitea/workflows/ci.yaml +++ b/.gitea/workflows/ci.yaml @@ -59,6 +59,11 @@ jobs: keymaps: name: editor keymaps runs-on: ubuntu-latest + # Serialise behind the cargo jobs so we never compete with them + # for runners, and inherit their warm cargo cache instead of + # forcing a release build of our own. + needs: test + timeout-minutes: 10 steps: - uses: actions/checkout@v4 - uses: dtolnay/rust-toolchain@1.83 diff --git a/scripts/test-keymaps-vim.sh b/scripts/test-keymaps-vim.sh index 9231ecb..77127c8 100755 --- a/scripts/test-keymaps-vim.sh +++ b/scripts/test-keymaps-vim.sh @@ -41,9 +41,11 @@ EOF RESULTS="$TMP/results.txt" log "running harness…" +# `"$TMP/vim.log" 2>&1 || true + timeout 30 vim -e -s -u "$VIMRC" -c "edit $SEED" -c "source $REPO_ROOT/scripts/test-keymaps-vim.vim" \ + "$TMP/vim.log" 2>&1 || true if [[ ! -f "$RESULTS" ]]; then echo 'keymap test harness produced no output' >&2 diff --git a/scripts/test-keymaps.sh b/scripts/test-keymaps.sh index 6a64e3a..c38a79c 100755 --- a/scripts/test-keymaps.sh +++ b/scripts/test-keymaps.sh @@ -46,8 +46,10 @@ log "running harness…" # `nvim --headless -u init.lua FILE +luafile …` — the harness's # `vim.defer_fn` lets the LSP attach before tests fire, then writes # the results file and exits. Output path is plumbed through env. +# Wrapped in `timeout` so a hung LSP / harness fails fast instead of +# stalling CI runners indefinitely. NUWIKI_KEYMAP_RESULTS="$RESULTS" \ - nvim --clean -u "$INIT" --headless "$TMP/wiki/index.wiki" \ + timeout 60 nvim --clean -u "$INIT" --headless "$TMP/wiki/index.wiki" \ -c "luafile $REPO_ROOT/scripts/test-keymaps.lua" \ >"$TMP/nvim.log" 2>&1 || true