Skip to content

Commit

Permalink
fix(ci): fix ci pipeline errors (#184)
Browse files Browse the repository at this point in the history
chore(commons): migrate to latest commons (#184)
  • Loading branch information
linrongbin16 committed Jan 4, 2024
1 parent a1f4153 commit 13bd6b1
Show file tree
Hide file tree
Showing 15 changed files with 421 additions and 537 deletions.
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 @@ local function _blame(lk)
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 Down Expand Up @@ -398,7 +398,10 @@ local link = async.void(function(opts)
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 function setup(opts)
local lend =
math.max(r.lstart, r.lend, command_opts.line1, command_opts.line2)
local parsed = _parse_args(args)
link({
void_link({
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

0 comments on commit 13bd6b1

Please sign in to comment.