mirror of
https://github.com/nvim-treesitter/nvim-treesitter.git
synced 2026-07-19 11:50:09 -04:00
ci: skip swift check on neovim stable
This is meant as a temporary workaround until neovim 0.7 is released. More context: https://github.com/nvim-treesitter/nvim-treesitter/issues/2313#issuecomment-1025258357
This commit is contained in:
parent
51a09ce8a2
commit
6799824f6b
2 changed files with 33 additions and 22 deletions
|
|
@ -84,7 +84,14 @@ jobs:
|
||||||
run: cp -r ~/AppData/Local/nvim/pack/nvim-treesitter/start/nvim-treesitter/parser/* parser
|
run: cp -r ~/AppData/Local/nvim/pack/nvim-treesitter/start/nvim-treesitter/parser/* parser
|
||||||
shell: bash
|
shell: bash
|
||||||
|
|
||||||
|
# NOTE: this is a temporary workaround to skip swift tests on ubuntu
|
||||||
|
# stable and should be removed once neovim 0.7 is released.
|
||||||
|
- if: matrix.os == 'ubuntu-latest' && matrix.nvim_tag == 'stable'
|
||||||
|
run: echo "SKIP_SWIFT_CHECK=TRUE" >> $GITHUB_ENV
|
||||||
|
|
||||||
- name: Check query files (Unix)
|
- name: Check query files (Unix)
|
||||||
|
env:
|
||||||
|
SKIP_SWIFT_CHECK: ${{ env.SKIP_SWIFT_CHECK }}
|
||||||
if: matrix.os != 'windows-2022'
|
if: matrix.os != 'windows-2022'
|
||||||
run: nvim --headless -c "luafile ./scripts/check-queries.lua" -c "q"
|
run: nvim --headless -c "luafile ./scripts/check-queries.lua" -c "q"
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -44,28 +44,32 @@ local function do_check()
|
||||||
io_print "::group::Check parsers"
|
io_print "::group::Check parsers"
|
||||||
|
|
||||||
for _, lang in pairs(parsers) do
|
for _, lang in pairs(parsers) do
|
||||||
timings[lang] = {}
|
-- NOTE: this is a temporary workaround to skip swift tests on ubuntu
|
||||||
for _, query_type in pairs(query_types) do
|
-- stable and should be removed once neovim 0.7 is released.
|
||||||
local before = vim.loop.hrtime()
|
if vim.fn.getenv "SKIP_SWIFT_CHECK" == vim.NIL or lang ~= "swift" then
|
||||||
local ok, query = pcall(queries.get_query, lang, query_type)
|
timings[lang] = {}
|
||||||
local after = vim.loop.hrtime()
|
for _, query_type in pairs(query_types) do
|
||||||
local duration = after - before
|
local before = vim.loop.hrtime()
|
||||||
table.insert(timings, { duration = duration, lang = lang, query_type = query_type })
|
local ok, query = pcall(queries.get_query, lang, query_type)
|
||||||
io_print("Checking " .. lang .. " " .. query_type .. string.format(" (%.02fms)", duration * 1e-6))
|
local after = vim.loop.hrtime()
|
||||||
if not ok then
|
local duration = after - before
|
||||||
vim.api.nvim_err_writeln(query)
|
table.insert(timings, { duration = duration, lang = lang, query_type = query_type })
|
||||||
last_error = query
|
io_print("Checking " .. lang .. " " .. query_type .. string.format(" (%.02fms)", duration * 1e-6))
|
||||||
else
|
if not ok then
|
||||||
if query then
|
vim.api.nvim_err_writeln(query)
|
||||||
for _, capture in ipairs(query.captures) do
|
last_error = query
|
||||||
local is_valid = (
|
else
|
||||||
vim.startswith(capture, "_") -- Helpers.
|
if query then
|
||||||
or vim.tbl_contains(captures[query_type], capture)
|
for _, capture in ipairs(query.captures) do
|
||||||
)
|
local is_valid = (
|
||||||
if not is_valid then
|
vim.startswith(capture, "_") -- Helpers.
|
||||||
local error = string.format("(x) Invalid capture @%s in %s for %s.", capture, query_type, lang)
|
or vim.tbl_contains(captures[query_type], capture)
|
||||||
io_print(error)
|
)
|
||||||
last_error = error
|
if not is_valid then
|
||||||
|
local error = string.format("(x) Invalid capture @%s in %s for %s.", capture, query_type, lang)
|
||||||
|
io_print(error)
|
||||||
|
last_error = error
|
||||||
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue