Skip to content

Commit de64bcb

Browse files
committed
build: fixed workflow
1 parent de30e44 commit de64bcb

4 files changed

Lines changed: 26 additions & 15 deletions

File tree

.github/workflows/ci.yml

Lines changed: 9 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -22,12 +22,11 @@ jobs:
2222
runs-on: ubuntu-latest
2323
steps:
2424
- uses: actions/checkout@v4
25-
- uses: leafo/gh-actions-lua@v10
26-
with:
27-
luaVersion: "luajit-2.1.0-beta3"
28-
- uses: leafo/gh-actions-luarocks@v4
29-
- name: Install luacheck
30-
run: luarocks install luacheck
25+
- name: Install Lua and luacheck
26+
run: |
27+
sudo apt-get update
28+
sudo apt-get install -y lua5.4 luarocks
29+
sudo luarocks install luacheck
3130
- name: Run luacheck
3231
run: luacheck lua/ plugin/
3332

@@ -45,11 +44,10 @@ jobs:
4544
with:
4645
neovim: true
4746
version: ${{ matrix.neovim }}
48-
- name: Cache test deps
49-
uses: actions/cache@v4
50-
with:
51-
path: .test-deps
52-
key: test-deps-${{ matrix.neovim }}-${{ hashFiles('tests/minimal_init.lua') }}
47+
- name: Install C compiler (for treesitter parsers)
48+
run: |
49+
sudo apt-get update
50+
sudo apt-get install -y build-essential
5351
- name: Run headless smoke test
5452
env:
5553
OPENAPI_TEST_DEPS: ${{ github.workspace }}/.test-deps

.luacheckrc

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,13 @@ std = "luajit"
33
cache = true
44
codes = true
55

6-
-- Globals provided by the Neovim runtime / plugins.
6+
-- `vim` is writable (we set vim.g.* flags), so declare it as a mutable global
7+
-- with known writable fields rather than read-only.
8+
globals = {
9+
"vim.g",
10+
}
11+
12+
-- Globals provided by the Neovim runtime / plugins (read-only).
713
read_globals = {
814
"vim",
915
"Snacks",

lua/openapi/parser/model.lua

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ local function parse_paths(paths_node, bufnr, ops)
5656
if not paths_node then
5757
return
5858
end
59-
for path_key, path_val, path_text in ts.iter_pairs(paths_node, bufnr) do
59+
for _, path_val, path_text in ts.iter_pairs(paths_node, bufnr) do
6060
if path_text and path_text:sub(1, 1) == "/" then
6161
for m_key, _, m_text in ts.iter_pairs(path_val, bufnr) do
6262
if m_text and HTTP_METHODS[m_text:lower()] then
@@ -85,9 +85,9 @@ local function parse_components(components_node, bufnr, comps, targets)
8585
if not components_node then
8686
return
8787
end
88-
for _kind_key, kind_val, kind_text in ts.iter_pairs(components_node, bufnr) do
88+
for _, kind_val, kind_text in ts.iter_pairs(components_node, bufnr) do
8989
if kind_text then
90-
for name_key, _name_val, name_text in ts.iter_pairs(kind_val, bufnr) do
90+
for name_key, _, name_text in ts.iter_pairs(kind_val, bufnr) do
9191
if name_text then
9292
local pointer = "/components/" .. kind_text .. "/" .. name_text
9393
local pos = mkpos(name_key)

tests/minimal_init.lua

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,3 +36,10 @@ vim.opt.runtimepath:prepend(root())
3636
if pcall(require, "nvim-treesitter.configs") then
3737
pcall(vim.cmd, "TSInstallSync! yaml")
3838
end
39+
40+
-- Fail loudly if the yaml parser still isn't available, so CI surfaces the
41+
-- real cause instead of the smoke test silently doing nothing.
42+
if not pcall(vim.treesitter.language.add, "yaml") then
43+
io.stderr:write("FATAL: yaml treesitter parser is not available\n")
44+
vim.cmd("cquit 1")
45+
end

0 commit comments

Comments
 (0)