diff --git a/.busted b/.busted new file mode 100644 index 0000000..a8d9d0c --- /dev/null +++ b/.busted @@ -0,0 +1,12 @@ +return { + _all = { + coverage = false, + lpath = "lua/?.lua;lua/?/init.lua", + }, + default = { + verbose = true, + }, + tests = { + verbose = true, + }, +} diff --git a/.github/workflows/lint.yml b/.github/workflows/ci.yml similarity index 67% rename from .github/workflows/lint.yml rename to .github/workflows/ci.yml index 8f94785..fbfc1a4 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/ci.yml @@ -3,6 +3,12 @@ name: Lint and style on: [push, pull_request] jobs: + commit_lint: + runs-on: ubuntu-latest + steps: + # Check commit messages + - uses: webiny/action-conventional-commits@v1.3.0 + stylua: name: stylua runs-on: ubuntu-20.04 diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..a607b5e --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,26 @@ +name: LuaRocks release +on: + push: + tags: # Will upload to luarocks.org when a tag is pushed + - "*" + pull_request: # Will test a local install without uploading to luarocks.org + +jobs: + luarocks-release: + runs-on: ubuntu-latest + name: LuaRocks upload + steps: + - name: Checkout + uses: actions/checkout@v3 + - name: LuaRocks Upload + uses: nvim-neorocks/luarocks-tag-release@v5 + with: + test_interpreters: | + neovim-stable + neovim-nightly + dependencies: | + luassert + test_dependencies: | + luassert + env: + LUAROCKS_API_KEY: ${{ secrets.LUAROCKS_API_KEY }} diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..bb1284f --- /dev/null +++ b/.gitignore @@ -0,0 +1,4 @@ +/luarocks +/lua_modules +/.luarocks +/lua diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..4bc0ef1 --- /dev/null +++ b/Makefile @@ -0,0 +1,13 @@ +nvim-test: + git clone https://github.com/lewis6991/nvim-test + nvim-test/bin/nvim-test --init + +.PHONY: test +test: nvim-test + NVIM_TEST_VERSION=$(NVIM_TEST_VERSION) \ + nvim-test/bin/nvim-test tests \ + --lpath=$(PWD)/lua/?.lua \ + --verbose \ + --filter="$(FILTER)" + + -@stty sane diff --git a/README.md b/README.md index 3a0c6ba..36b13de 100644 --- a/README.md +++ b/README.md @@ -24,6 +24,8 @@ Please follow along with the [initial release discussion](https://github.com/kid Use your favourite plugin manager to install it. eg: +Using [packer.nvim](https://github.com/wbthomason/packer.nvim) + ```lua use { 'kid-icarus/jira.nvim', @@ -31,11 +33,23 @@ use { 'jcdickinson/http.nvim', } config = function () - require'jira'.setup() + require'jira'.setup() -- see configuration section end } ``` +Using [lazygit.nvim](https://github.com/folke/lazy.nvim) + +```lua +{ + 'kid-icarus/jira.nvim', + dependencies = { + 'jcdickinson/http.nvim', + }, + opts = {}, -- see configuration section +} +``` + ## ⚙️ Configuration First of all, you'll need to create a [personal Jira API diff --git a/jira.nvim-scm-1.rockspec b/jira.nvim-scm-1.rockspec new file mode 100644 index 0000000..cf76b8c --- /dev/null +++ b/jira.nvim-scm-1.rockspec @@ -0,0 +1,22 @@ +local _MODREV, _SPECREV = 'scm', '-1' +rockspec_format = '3.0' +package = 'jira.nvim' +version = _MODREV .. _SPECREV + +description = { + summary = 'Jira integration for Neovim', + labels = { 'neovim' }, + detailed = [[ + jira.nvim: interact with Jira from Neovim, using the Jira REST API. + ]], + homepage = 'http://github.com/kid-icarus/jira.nvim', + license = 'MIT/X11', +} + +dependencies = { + 'lua >= 5.1, < 5.4', +} + +source = { + url = 'git://github.com/kid-icarus/jira.nvim', +} diff --git a/nvim-test b/nvim-test new file mode 160000 index 0000000..94b485a --- /dev/null +++ b/nvim-test @@ -0,0 +1 @@ +Subproject commit 94b485af0c63719097be95d3ef099f078b1be668 diff --git a/run-tests.sh b/run-tests.sh new file mode 100755 index 0000000..b4940c5 --- /dev/null +++ b/run-tests.sh @@ -0,0 +1,13 @@ +#!/bin/sh +BUSTED_VERSION="2.1.2-3" + +# Install busted if it is not already installed, sometimes you have to run this multiple times +# because busted is trying to use a 5.4 version of lua +if [ ! -d "lua_modules" ]; then + luarocks init + luarocks install busted "$BUSTED_VERSION" + luarocks config --scope project lua_version 5.1 +fi +nvim -u NONE \ + -c "lua package.path='lua_modules/share/lua/5.1/?.lua;lua_modules/share/lua/5.1/?/init.lua;'..package.path;package.cpath='lua_modules/lib/lua/5.1/?.so;'..package.cpath;local k,l,_=pcall(require,'luarocks.loader') _=k and l.add_context('busted','$BUSTED_VERSION')" \ + -l "lua_modules/lib/luarocks/rocks-5.1/busted/$BUSTED_VERSION/bin/busted" diff --git a/tests/utils_spec.lua b/spec/utils_spec.lua similarity index 100% rename from tests/utils_spec.lua rename to spec/utils_spec.lua