-
Notifications
You must be signed in to change notification settings - Fork 0
92 lines (80 loc) · 2.76 KB
/
lua.yml
File metadata and controls
92 lines (80 loc) · 2.76 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
name: Lua Tests
env:
FORCE_JAVASCRIPT_ACTIONS_TO_NODE24: true
on:
push:
branches: [master]
paths:
- "lua/**"
- "tests/**"
- ".github/workflows/lua.yml"
pull_request:
branches: [master]
paths:
- "lua/**"
- "tests/**"
- ".github/workflows/lua.yml"
jobs:
busted:
name: busted (pure-Lua unit tests)
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install LuaRocks + busted
run: |
sudo apt-get update -q
sudo apt-get install -y luarocks
sudo luarocks install busted
- name: Run unit tests
run: busted --lpath='lua/?.lua;lua/?/init.lua' tests/unit/
nvim_integration:
name: Neovim integration (${{ matrix.nvim }})
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
nvim:
- nightly
- v0.12.2
- v0.12.0
steps:
- uses: actions/checkout@v4
- run: date +%F > todays-date
- name: Restore Neovim cache
uses: actions/cache@v4
with:
path: _neovim
key: ${{ runner.os }}-nvim-${{ matrix.nvim }}-${{ hashFiles('todays-date') }}
- name: Download Neovim
run: |
if [ "${{ matrix.nvim }}" = "nightly" ]; then
URL=https://github.com/neovim/neovim/releases/download/nightly/nvim-linux-x86_64.tar.gz
else
URL=https://github.com/neovim/neovim/releases/download/${{ matrix.nvim }}/nvim-linux-x86_64.tar.gz
fi
test -d _neovim || {
mkdir -p _neovim
curl -sL "$URL" | tar xzf - --strip-components=1 -C _neovim
}
- name: Install test plugins
run: |
mkdir -p ~/.local/share/nvim/site/pack/vendor/start
test -d ~/.local/share/nvim/site/pack/vendor/start/plenary.nvim || \
git clone --depth 1 https://github.com/nvim-lua/plenary.nvim \
~/.local/share/nvim/site/pack/vendor/start/plenary.nvim
test -d ~/.local/share/nvim/site/pack/vendor/start/nvim-treesitter || \
git clone --depth 1 https://github.com/nvim-treesitter/nvim-treesitter \
~/.local/share/nvim/site/pack/vendor/start/nvim-treesitter
ln -s "$PWD" ~/.local/share/nvim/site/pack/vendor/start/copilot-agent.nvim
- name: Run integration tests
run: |
export PATH="${PWD}/_neovim/bin:${PATH}"
export XDG_CONFIG_HOME="$(mktemp -d)"
export XDG_DATA_HOME="$(mktemp -d)"
export XDG_STATE_HOME="$(mktemp -d)"
export XDG_CACHE_HOME="$(mktemp -d)"
nvim --headless -u tests/minimal_init.lua \
-c "PlenaryBustedFile tests/integration/setup_spec.lua" \
-c qa \
2>&1
echo "Exit code: $?"