Skip to content

Commit

Permalink
Migrate CI to use nlua/busted
Browse files Browse the repository at this point in the history
  • Loading branch information
mfussenegger committed Jun 2, 2024
1 parent 4760520 commit 3b9caf8
Show file tree
Hide file tree
Showing 6 changed files with 67 additions and 22 deletions.
13 changes: 13 additions & 0 deletions .busted
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
return {
_all = {
coverage = false,
lpath = "lua/?.lua;lua/?/init.lua",
lua = "~/.luarocks/bin/nlua",
},
default = {
verbose = true
},
tests = {
verbose = true
},
}
33 changes: 15 additions & 18 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,32 +12,29 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
neovim_version: ['nightly', 'v0.9.5', 'v0.10.0']
neovim_version: ['nightly', 'v0.10.0']

steps:
- uses: actions/checkout@v2
- run: date +%F > todays-date
- name: Restore cache for today's nightly.
uses: actions/cache@v2
- uses: actions/checkout@v4
with:
path: _neovim
key: ${{ runner.os }}-x64-${{ hashFiles('todays-date') }}
ref: ${{ github.ref }}

- name: Prepare plenary
run: |
git clone --depth 1 https://github.com/nvim-lua/plenary.nvim ~/.local/share/nvim/site/pack/vendor/start/plenary.nvim
ln -s "$(pwd)" ~/.local/share/nvim/site/pack/vendor/start
- name: Prepare nvim-dap
run: |
git clone --depth 1 https://github.com/mfussenegger/nvim-dap ~/.local/share/nvim/site/pack/vendor/start/nvim-dap
- name: Setup neovim
- name: Install neovim
uses: rhysd/action-setup-vim@v1
with:
neovim: true
version: ${{ matrix.neovim_version }}

- name: Install Lua
uses: leso-kn/gh-actions-lua@master
with:
luaVersion: "5.1"

- name: Install Luarocks
uses: hishamhm/gh-actions-luarocks@master
with:
luarocksVersion: "3.11.0"

- name: Run tests
run: |
nvim --headless --noplugin -u tests/minimal.vim -c "PlenaryBustedDirectory tests/ {minimal_init = 'tests/minimal.vim'}"
luarocks test --local
38 changes: 38 additions & 0 deletions nvim-dap-python-scm-1.rockspec
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
local _MODREV, _SPECREV = 'scm', '-1'
rockspec_format = "3.0"
package = 'nvim-dap-python'
version = _MODREV .. _SPECREV

description = {
summary = 'Python extension for nvim-dap',
labels = {
'neovim',
'plugin',
'debug-adapter-protocol',
'debugger',
'python',
},
homepage = 'https://github.com/mfussenegger/nvim-dap-python',
license = 'GPL-3.0',
}

dependencies = {
'lua >= 5.1, < 5.4',
'nvim-dap',
}

test_dependencies = {
"nlua",
}

source = {
url = 'git://github.com/mfussenegger/nvim-dap-python',
}

build = {
type = 'builtin',
copy_directories = {
'doc',
'plugin',
},
}
2 changes: 1 addition & 1 deletion tests/debugpy_spec.lua → spec/debugpy_spec.lua
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ describe('dap with debugpy', function()
end)

it('Can start session and break at breakpoint', function()
local program = vim.fn.expand('%:p:h') .. '/tests/simple.py'
local program = vim.fn.expand('%:p:h') .. '/spec/simple.py'
local config = {
type = 'python',
request = 'launch',
Expand Down
File renamed without changes.
3 changes: 0 additions & 3 deletions tests/minimal.vim

This file was deleted.

0 comments on commit 3b9caf8

Please sign in to comment.