Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(ci): fix ci pipeline errors #184

Merged
merged 13 commits into from
Jan 4, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 30 additions & 4 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,8 @@ jobs:
commit_message: "chore(pr): auto-commit"
unit_test:
name: Unit Test
needs:
- luacheck
strategy:
matrix:
nvim_version: [stable, nightly, v0.7.0]
Expand All @@ -77,11 +79,35 @@ jobs:
shell: bash
run: |
luarocks install luacheck
luarocks install luacov
luarocks install cluacov
luarocks install vusted
vusted --coverage --shuffle ./test
vusted --shuffle ./test
code_coverage:
name: Code Coverage
needs:
- luacheck
strategy:
matrix:
nvim_version: [stable]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: rhysd/action-setup-vim@v1
id: vim
with:
neovim: true
version: ${{ matrix.nvim_version }}
- uses: leafo/gh-actions-lua@v10
with:
luaVersion: "luajit-2.1.0-beta3"
- uses: leafo/gh-actions-luarocks@v4
- name: Generate Coverage Reports
shell: bash
run: |
luarocks install luacheck
luarocks install luacov
luarocks install vusted
vusted --coverage ./test
- name: Upload Coverage Reports
shell: bash
run: |
echo "ls ."
Expand All @@ -101,8 +127,8 @@ jobs:
name: Release
if: ${{ github.ref == 'refs/heads/master' }}
needs:
- luacheck
- unit_test
- code_coverage
runs-on: ubuntu-latest
steps:
- uses: google-github-actions/release-please-action@v3
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<!-- markdownlint-disable MD013 MD034 -->
<!-- markdownlint-disable MD013 MD034 MD033 -->

# gitlinker.nvim

Expand Down
13 changes: 8 additions & 5 deletions lua/gitlinker.lua
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
local async = require("gitlinker.async")
local async = require("gitlinker.commons.async")
local range = require("gitlinker.range")
local LogLevels = require("gitlinker.commons.logging").LogLevels
local logging = require("gitlinker.commons.logging")
Expand Down Expand Up @@ -352,8 +352,8 @@
return _router("blame", lk)
end

--- @type fun(opts:{action:gitlinker.Action?,router:gitlinker.Router,lstart:integer,lend:integer,remote:string?}):string?
local link = async.void(function(opts)
--- @param opts {action:gitlinker.Action?,router:gitlinker.Router,lstart:integer,lend:integer,remote:string?}
local link = function(opts)
local logger = logging.get("gitlinker") --[[@as commons.logging.Logger]]
-- logger.debug("[link] merged opts: %s", vim.inspect(opts))

Expand All @@ -364,7 +364,7 @@
lk.lstart = opts.lstart
lk.lend = opts.lend

async.scheduler()

Check warning on line 367 in lua/gitlinker.lua

View check run for this annotation

Codecov / codecov/patch

lua/gitlinker.lua#L367

Added line #L367 was not covered by tests
local ok, url = pcall(opts.router, lk, true)
logger:debug(
"|link| ok:%s, url:%s, router:%s",
Expand Down Expand Up @@ -398,7 +398,10 @@
end

return url
end)
end

--- @type fun(opts:{action:gitlinker.Action?,router:gitlinker.Router,lstart:integer,lend:integer,remote:string?}):string?
local void_link = async.void(link)

--- @param opts gitlinker.Options
--- @return table<string, {list_routers:table,map_routers:table}>
Expand Down Expand Up @@ -541,7 +544,7 @@
local lend =
math.max(r.lstart, r.lend, command_opts.line1, command_opts.line2)
local parsed = _parse_args(args)
link({
void_link({

Check warning on line 547 in lua/gitlinker.lua

View check run for this annotation

Codecov / codecov/patch

lua/gitlinker.lua#L547

Added line #L547 was not covered by tests
action = command_opts.bang and require("gitlinker.actions").system
or require("gitlinker.actions").clipboard,
router = function(lk)
Expand Down
282 changes: 0 additions & 282 deletions lua/gitlinker/async.lua

This file was deleted.

Loading
Loading