-
Notifications
You must be signed in to change notification settings - Fork 2
67 lines (58 loc) · 2.03 KB
/
Copy pathci.yml
File metadata and controls
67 lines (58 loc) · 2.03 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
name: CI
on:
push:
branches: [main, codecov-dev]
pull_request:
branches: [main]
jobs:
test:
name: Neovim ${{ matrix.neovim }}
runs-on: ubuntu-latest
strategy:
matrix:
neovim: ["stable", "v0.10.0", "nightly"]
steps:
- name: Checkout plugin
uses: actions/checkout@v4
- name: Install Neovim ${{ matrix.neovim }}
run: |
set -euo pipefail
VERSION=${{ matrix.neovim }}
if [[ "$VERSION" =~ ^v0\.[0-9]+\. ]]; then
FILENAME=nvim-linux64.tar.gz
else
FILENAME=nvim-linux-x86_64.tar.gz
fi
URL="https://github.com/neovim/neovim/releases/download/${VERSION}/${FILENAME}"
echo "Downloading $URL"
curl -fL -o nvim.tar.gz "$URL"
mkdir nvim-extract
tar -xzf nvim.tar.gz -C nvim-extract
DIR="$(ls nvim-extract | head -n1)"
sudo mv "nvim-extract/$DIR" /opt/nvim
echo "/opt/nvim/bin" >> "$GITHUB_PATH"
- name: Verify Neovim
run: nvim --version
- name: Install Plenary
run: |
mkdir -p ~/.local/share/nvim/site/pack/test/start
git clone https://github.com/nvim-lua/plenary.nvim ~/.local/share/nvim/site/pack/test/start/plenary.nvim
- name: Install LuaRocks + luacheck + coverage tools
run: |
set -euo pipefail
sudo apt-get update
sudo apt-get install -y lua5.1 liblua5.1-0-dev luarocks make
luarocks --lua-version=5.1 --local install luacheck
luarocks --lua-version=5.1 --local install luacov
luarocks --lua-version=5.1 --local install luacov-reporter-lcov
echo "$HOME/.luarocks/bin" >> "$GITHUB_PATH"
- name: Run tests and generate coverage
run: |
eval "$(luarocks --lua-version=5.1 path)"
make coverage
- name: Upload code coverage
uses: codecov/codecov-action@v4
with:
files: lcov.info
disable_search: true
token: ${{ secrets.CODECOV_TOKEN }}