Skip to content

Commit 7813c35

Browse files
Merge pull request #15 from venkatarenduchintala/feat/ci-plugin-validation
feat(ci): validate neovim with all plugins via lazy.nvim sync
2 parents d63dd23 + 3880e8f commit 7813c35

3 files changed

Lines changed: 91 additions & 76 deletions

File tree

.github/workflows/validate.yml

Lines changed: 29 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,9 +38,36 @@ jobs:
3838
- name: Check Neovim version
3939
run: docker run --rm nvim-config:ci nvim --version
4040

41-
- name: Validate Neovim starts headless
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
4266
run: |
4367
docker run --rm \
68+
-e CI=true \
4469
-v "${{ github.workspace }}:/home/dev/.config/nvim:ro" \
70+
-v "$HOME/.local/share/nvim-ci:/home/dev/.local/share/nvim" \
4571
nvim-config:ci \
46-
nvim --headless --noplugin +qall
72+
nvim --headless -c "qall"
73+
timeout-minutes: 2

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,3 +64,4 @@ package-lock.json
6464
# Built Visual Studio Code Extensions
6565
*.vsix
6666
.vscode/settings.json
67+
devcontainer-lock.json

lua/plugins/configs/mason.lua

Lines changed: 61 additions & 74 deletions
Original file line numberDiff line numberDiff line change
@@ -3,99 +3,86 @@ return {
33
"mason-org/mason.nvim",
44
config = function()
55
require("mason").setup({
6-
ui = {
7-
icons = {
8-
package_installed = "",
9-
package_pending = "",
10-
package_uninstalled = "",
11-
}
12-
}
13-
})
6+
ui = {
7+
icons = {
8+
package_installed = "",
9+
package_pending = "",
10+
package_uninstalled = "",
11+
},
12+
},
13+
})
1414
end,
1515
},
1616
{
1717
"mason-org/mason-lspconfig.nvim",
1818
config = function()
1919
require("mason-lspconfig").setup({
2020
automatic_enable = false,
21-
ensure_installed = {
22-
"ansiblels",
23-
"awk_ls",
24-
"bashls",
25-
"clangd",
21+
-- skip heavy binary downloads in CI; lazy.nvim plugin code is still validated
22+
ensure_installed = vim.env.CI and {} or {
23+
"ansiblels",
24+
"awk_ls",
25+
"bashls",
26+
"clangd",
2627
"docker_compose_language_service",
2728
"dockerls",
2829
"dotls",
29-
"elixirls",
30+
"elixirls",
3031
"eslint",
31-
"gradle_ls",
32-
"groovyls",
32+
"gradle_ls",
33+
"groovyls",
3334
"html",
34-
"jdtls",
35-
"jqls",
36-
"jsonls",
37-
"kotlin_language_server",
35+
"jdtls",
36+
"jqls",
37+
"jsonls",
38+
"kotlin_language_server",
3839
"lua_ls",
39-
"matlab_ls",
40-
"perlnavigator",
41-
"pyright",
40+
"matlab_ls",
41+
"perlnavigator",
42+
"pyright",
4243
"rust_analyzer",
4344
"tsp_server",
4445
"yamlls",
4546
},
4647
})
4748
end,
4849
},
49-
{
50-
"williamboman/mason.nvim",
51-
"mfussenegger/nvim-lint",
52-
"rshkarin/mason-nvim-lint",
53-
config = function()
54-
require('mason-nvim-lint').setup({
55-
-- Whether linters that are set up (via nvim-lint) should be automatically installed if they're not already installed.
56-
-- It tries to find the specified linters in the mason's registry to proceed with installation.
57-
-- This setting has no relation with the `ensure_installed` setting.
58-
---@type boolean
59-
automatic_installation = true,
60-
61-
-- Disables warning notifications about misconfigurations such as invalid linter entries and incorrect plugin load order.
62-
quiet_mode = false,
63-
64-
-- A list of linters to automatically install if they're not already installed. Example: { "eslint_d", "revive" }
65-
-- This setting has no relation with the `automatic_installation` setting.
66-
-- Names of linters should be taken from the mason's registry.
67-
---@type string[]
68-
ensure_installed = {
69-
"actionlint",
70-
"ansible-lint",
71-
"api-linter",
72-
"black",
73-
"cmakelang",
74-
"csharpier",
75-
"cpplint",
76-
"dotenv-linter",
77-
"elm-formatter",
78-
"eslint_d",
79-
"jq",
80-
"kube-linter",
81-
"luacheck",
82-
"markdownlint",
83-
"markdown-toc",
84-
"prettier",
85-
"pylint",
86-
"xmlformatter",
87-
"yamlfix",
88-
"yamlfmt",
89-
"yamllint",
90-
"zsh",
91-
},
92-
93-
-- Avoid trying to install an unknown linter
94-
ignore_install = {},
95-
96-
})
97-
end,
98-
},
50+
{
51+
"williamboman/mason.nvim",
52+
"mfussenegger/nvim-lint",
53+
"rshkarin/mason-nvim-lint",
54+
config = function()
55+
require("mason-nvim-lint").setup({
56+
automatic_installation = not vim.env.CI,
57+
quiet_mode = false,
58+
ensure_installed = vim.env.CI and {} or {
59+
"actionlint",
60+
"ansible-lint",
61+
"api-linter",
62+
"black",
63+
"cmakelang",
64+
"csharpier",
65+
"cpplint",
66+
"dotenv-linter",
67+
"elm-formatter",
68+
"eslint_d",
69+
"jq",
70+
"kube-linter",
71+
"luacheck",
72+
"markdownlint",
73+
"markdown-toc",
74+
"prettier",
75+
"pylint",
76+
"xmlformatter",
77+
"yamlfix",
78+
"yamlfmt",
79+
"yamllint",
80+
"zsh",
81+
},
82+
ignore_install = {},
83+
})
84+
end,
85+
},
9986
{
10087
"williamboman/mason-nvim-dap.nvim",
10188
dependencies = {
@@ -105,7 +92,7 @@ return {
10592
},
10693
config = function()
10794
require("mason-nvim-dap").setup({
108-
ensure_installed = {
95+
ensure_installed = vim.env.CI and {} or {
10996
"codelldb",
11097
"javatest",
11198
"javadbg",

0 commit comments

Comments
 (0)