Skip to content

Commit 7b6f1d9

Browse files
author
Venkata Subramani Renduchintala
committed
fix(ci): run all nvim validations in a single container
Replace per-step docker run commands (which failed due to DinD bind-mount path mismatch between act runner and host Docker daemon) with a single docker run executing test/ci_validate.sh. Bootstrap lazy.nvim and all plugin installs happen inside the same container where git and network are both available.
1 parent 287317a commit 7b6f1d9

3 files changed

Lines changed: 43 additions & 52 deletions

File tree

.github/workflows/validate.yml

Lines changed: 4 additions & 52 deletions
Original file line numberDiff line numberDiff line change
@@ -38,60 +38,12 @@ jobs:
3838
- name: Check Neovim version
3939
run: docker run --rm nvim-config:ci nvim --version
4040

41-
- name: Prepare plugin data directory
42-
run: |
43-
mkdir -p $HOME/.local/share/nvim-ci
44-
chmod 777 $HOME/.local/share/nvim-ci
45-
46-
- name: Cache lazy.nvim plugins
47-
uses: actions/cache@v4
48-
with:
49-
path: ~/.local/share/nvim-ci
50-
key: nvim-plugins-${{ hashFiles('lua/plugins/**/*.lua') }}
51-
restore-keys: nvim-plugins-
52-
53-
- name: Install plugins via lazy.nvim
54-
run: |
55-
docker run --rm \
56-
-e CI=true \
57-
-v "${{ github.workspace }}:/home/dev/.config/nvim:ro" \
58-
-v "$HOME/.local/share/nvim-ci:/home/dev/.local/share/nvim" \
59-
nvim-config:ci \
60-
nvim --headless \
61-
-c "lua require('lazy').sync({wait=true, show=false})" \
62-
-c "qall"
63-
timeout-minutes: 15
64-
65-
- name: Validate Neovim loads with all plugins
66-
run: |
67-
docker run --rm \
68-
-e CI=true \
69-
-v "${{ github.workspace }}:/home/dev/.config/nvim:ro" \
70-
-v "$HOME/.local/share/nvim-ci:/home/dev/.local/share/nvim" \
71-
nvim-config:ci \
72-
nvim --headless -c "qall"
73-
timeout-minutes: 2
74-
75-
- name: Install treesitter parsers (Go, Terraform, HCL)
76-
run: |
77-
docker run --rm \
78-
-e CI=true \
79-
-v "${{ github.workspace }}:/home/dev/.config/nvim:ro" \
80-
-v "$HOME/.local/share/nvim-ci:/home/dev/.local/share/nvim" \
81-
nvim-config:ci \
82-
nvim --headless \
83-
-c "luafile /home/dev/.config/nvim/test/install_parsers.lua" \
84-
-c "qall"
85-
timeout-minutes: 10
86-
87-
- name: Test Go and Terraform treesitter parsers
41+
- name: Run all Neovim validations
8842
run: |
8943
docker run --rm \
44+
--network=host \
9045
-e CI=true \
9146
-v "${{ github.workspace }}:/home/dev/.config/nvim:ro" \
92-
-v "$HOME/.local/share/nvim-ci:/home/dev/.local/share/nvim" \
9347
nvim-config:ci \
94-
nvim --headless \
95-
-c "luafile /home/dev/.config/nvim/test/validate_treesitter.lua" \
96-
-c "qall"
97-
timeout-minutes: 2
48+
bash /home/dev/.config/nvim/test/ci_validate.sh
49+
timeout-minutes: 30

test/ci_install_plugins.lua

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
-- Headless lazy.nvim plugin installer for CI.
2+
-- Exits 1 loudly if lazy.nvim is not loadable or sync fails.
3+
local ok, lazy = pcall(require, 'lazy')
4+
if not ok then
5+
io.stderr:write('FATAL: lazy.nvim not loadable: ' .. tostring(lazy) .. '\n')
6+
vim.cmd('cquit 1')
7+
end
8+
9+
print('lazy.nvim loaded, starting sync...')
10+
lazy.sync({ wait = true, show = false })
11+
print('lazy.nvim sync complete')

test/ci_validate.sh

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
#!/bin/bash
2+
set -e
3+
4+
echo "=== Bootstrapping lazy.nvim ==="
5+
git clone --filter=blob:none \
6+
https://github.com/folke/lazy.nvim.git \
7+
--branch=stable \
8+
"$HOME/.local/share/nvim/lazy/lazy.nvim"
9+
10+
echo "=== Installing plugins via lazy.nvim ==="
11+
nvim --headless \
12+
-c "luafile /home/dev/.config/nvim/test/ci_install_plugins.lua" \
13+
-c "qall"
14+
15+
echo "=== Validating Neovim startup with all plugins ==="
16+
nvim --headless -c "qall"
17+
18+
echo "=== Installing treesitter parsers (Go, Terraform, HCL) ==="
19+
nvim --headless \
20+
-c "luafile /home/dev/.config/nvim/test/install_parsers.lua" \
21+
-c "qall"
22+
23+
echo "=== Testing Go and Terraform treesitter parsers ==="
24+
nvim --headless \
25+
-c "luafile /home/dev/.config/nvim/test/validate_treesitter.lua" \
26+
-c "qall"
27+
28+
echo "=== All validations passed! ==="

0 commit comments

Comments
 (0)