Skip to content

Commit e50852a

Browse files
committed
test(github): add workflow to run unit tests
1 parent 9a72a68 commit e50852a

File tree

1 file changed

+61
-0
lines changed

1 file changed

+61
-0
lines changed

.github/workflows/tests.yml

Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
# From
2+
# https://github.com/shortcuts/neovim-plugin-boilerplate/blob/main/.github/workflows/main.yml
3+
4+
name: tests
5+
6+
on:
7+
push:
8+
pull_request:
9+
types: [opened, synchronize]
10+
11+
jobs:
12+
lint:
13+
runs-on: ubuntu-latest
14+
name: lint
15+
steps:
16+
- uses: actions/checkout@v4
17+
18+
- uses: JohnnyMorganz/stylua-action@v4
19+
with:
20+
token: ${{ secrets.GITHUB_TOKEN }}
21+
version: latest
22+
args: --check . -g '*.lua' -g '!deps/'
23+
24+
test:
25+
timeout-minutes: 4
26+
strategy:
27+
matrix:
28+
os: [ubuntu-latest]
29+
neovim_version: ["v0.10.3", "v0.11.4", "nightly"]
30+
include:
31+
- os: macos-latest
32+
neovim_version: v0.11.4
33+
- os: windows-latest
34+
neovim_version: v0.11.4
35+
runs-on: ${{ matrix.os }}
36+
37+
steps:
38+
- uses: actions/checkout@v4
39+
40+
- name: setup neovim
41+
uses: rhysd/action-setup-vim@v1
42+
with:
43+
neovim: true
44+
version: ${{ matrix.neovim_version }}
45+
46+
# only needed if testing in ssh but doesn't hurt
47+
- name: Add nvim to PATH
48+
run: echo "${{ steps.setup_nvim.outputs.executable }}" >> $GITHUB_PATH
49+
50+
- name: Install plenary
51+
run: |
52+
git clone --depth 1 https://github.com/nvim-lua/plenary.nvim ~/.local/share/nvim/site/pack/vendor/start/plenary.nvim
53+
54+
- name: Run tests
55+
run: ./run_tests.sh
56+
57+
# # For sshing in to debug GH actions
58+
# - name: Setup tmate session
59+
# uses: mxschmitt/action-tmate@v3
60+
# with:
61+
# detached: true

0 commit comments

Comments
 (0)