Skip to content

Commit 6af2c74

Browse files
committed
update CI
1 parent 3db95f2 commit 6af2c74

File tree

3 files changed

+31
-39
lines changed

3 files changed

+31
-39
lines changed

.github/workflows/ci.yml

Lines changed: 2 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@ jobs:
1414
version: latest
1515
args: --check .
1616

17-
1817
docs:
1918
runs-on: ubuntu-latest
2019
name: pandoc to vimdoc
@@ -24,40 +23,11 @@ jobs:
2423
- name: panvimdoc
2524
uses: kdheepak/panvimdoc@main
2625
with:
27-
vimdoc: nvim-plugin-template
26+
vimdoc: guard.nvim
2827
treesitter: true
2928
- uses: stefanzweifel/git-auto-commit-action@v4
3029
with:
31-
commit_message: 'chore(doc): auto generate docs'
30+
commit_message: "chore(doc): auto generate docs"
3231
commit_user_name: "github-actions[bot]"
3332
commit_user_email: "github-actions[bot]@users.noreply.github.com"
3433
commit_author: "github-actions[bot] <github-actions[bot]@users.noreply.github.com>"
35-
36-
test:
37-
name: Run Test
38-
runs-on: ${{ matrix.os }}
39-
strategy:
40-
matrix:
41-
os: [ubuntu-latest, macos-latest]
42-
steps:
43-
- uses: actions/checkout@v3
44-
- uses: rhysd/action-setup-vim@v1
45-
id: vim
46-
with:
47-
neovim: true
48-
version: nightly
49-
50-
- name: luajit
51-
uses: leafo/gh-actions-lua@v10
52-
with:
53-
luaVersion: "luajit-openresty"
54-
55-
- name: luarocks
56-
uses: leafo/gh-actions-luarocks@v4
57-
58-
- name: run test
59-
shell: bash
60-
run: |
61-
luarocks install luacheck
62-
luarocks install vusted
63-
vusted ./test

.github/workflows/test.yml

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
name: Run tests
2+
on:
3+
pull_request: ~
4+
push:
5+
branches:
6+
- main
7+
8+
jobs:
9+
build:
10+
name: Run tests
11+
runs-on: ubuntu-latest
12+
strategy:
13+
matrix:
14+
neovim_version: ['nightly', 'stable']
15+
16+
steps:
17+
- uses: actions/checkout@v4
18+
- name: Download stylua
19+
shell: bash
20+
run: |
21+
wget "https://github.com/JohnnyMorganz/StyLua/releases/download/v0.18.0/stylua-linux.zip" -P /home/runner/.local/bin
22+
unzip /home/runner/.local/bin/stylua-linux.zip -d /home/runner/.local/bin
23+
chmod +x /home/runner/.local/bin/stylua
24+
- name: Run tests
25+
uses: nvim-neorocks/nvim-busted-action@v1
26+
with:
27+
nvim_version: ${{ matrix.neovim_version }}

README.md

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -18,19 +18,14 @@ The CI uses `stylua` to format the code; customize the formatting by editing `.s
1818

1919
## Test
2020

21-
Uses [busted](https://lunarmodules.github.io/busted/) for testing. Installs by using `luarocks --lua-version=5.1 install vusted` then runs `vusted ./test`
22-
for your test cases. `vusted` is a wrapper of Busted especially for testing Neovim plugins.
23-
24-
Create test cases in the `test` folder. Busted expects files in this directory to be named `foo_spec.lua`, with `_spec` as a suffix before the `.lua` file extension. For more usage details please check
25-
[busted usage](https://lunarmodules.github.io/busted/)
21+
See [Running tests locally](https://github.com/nvim-neorocks/nvim-busted-action?tab=readme-ov-file#running-tests-locally)
2622

2723
## CI
2824

2925
- Auto generates doc from README.
30-
- Runs the Busted/vusted integration tests
26+
- Runs the [nvim-busted-action](https://github.com/nvim-neorocks/nvim-busted-action) for test.
3127
- Lints with `stylua`.
3228

33-
3429
## More
3530

3631
To see this template in action, take a look at my other plugins.

0 commit comments

Comments
 (0)