-
Notifications
You must be signed in to change notification settings - Fork 44
52 lines (44 loc) · 1.72 KB
/
tests.yml
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
name: Tests
on:
push:
branches: [ "main", "dev" ]
pull_request:
branches: [ "**" ]
jobs:
tests:
strategy:
matrix:
os: [ubuntu-latest]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v3
- id: branch-name
uses: tj-actions/branch-names@v6
- name: Install Neovim
shell: bash
run: |
mkdir -p /tmp/nvim
wget -q https://github.com/neovim/neovim/releases/download/nightly/nvim.appimage -O /tmp/nvim/nvim.appimage
cd /tmp/nvim
chmod a+x ./nvim.appimage
./nvim.appimage --appimage-extract
echo "/tmp/nvim/squashfs-root/usr/bin/" >> $GITHUB_PATH
- name: Clone nordic.nvim (PR)
if: github.event_name == 'pull_request'
run: |
mkdir -p ~/.local/share/nvim/site/pack/ci/start/
git clone --branch ${{ steps.branch-name.outputs.current_branch }} https://github.com/${{ github.event.pull_request.head.repo.full_name }} ~/.local/share/nvim/site/pack/ci/start/nordic.nvim;
- name: Clone nordic.nvim (Push)
if: github.event_name == 'push'
run: |
mkdir -p ~/.local/share/nvim/site/pack/ci/start/
git clone --branch ${{ steps.branch-name.outputs.current_branch }} https://github.com/${GITHUB_REPOSITORY} ~/.local/share/nvim/site/pack/ci/start/nordic.nvim;
- name: Test nordic.nvim
shell: bash
run: |
nvim --version
OUTPUT=$(nvim --headless -c "lua require('nordic.tests').run_tests()" -c 'q' 2>&1);
if [[ -n "$OUTPUT" ]]
then
echo "::error title='Checks failed'::$OUTPUT" && exit 1
fi