-
Notifications
You must be signed in to change notification settings - Fork 0
/
action.yml
77 lines (69 loc) · 2.11 KB
/
action.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
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
---
name: 'Nvim Busted Action'
description: 'Test Neovim plugins with Busted'
author: 'Marc Jakobi'
branding:
color: 'purple'
icon: 'moon'
inputs:
nvim_version:
description: |
Version of Neovim to install. Valid values are 'stable', 'nightly' or version tag such
as 'v0.9.2'. Note that this value must exactly match to a tag name when installing the
specific version.
required: false
default: 'stable'
luarocks_version:
description: Version of LuaRocks to install.
required: false
default: '3.11.1'
before:
description: Script to run before running tests.
required: false
default: ''
runs:
using: "composite"
steps:
- uses: actions/cache@v3
id: cache-luarocks
name: Restore cache for luarocks packages.
with:
path: |
~/.luarocks
key: ${{ runner.os }}-luarocks-${{ inputs.luarocks_version }}
restore-keys: |
${{ runner.os }}-luarocks-
- run: date +%F > todays-date
shell: bash
- name: Restore cache for today's Neovim nightly.
if: ${{ inputs.nvim_version }} == 'nightly'
uses: actions/cache@v3
with:
path: _neovim
key: ${{ runner.os }}-x64-${{ hashFiles('todays-date') }}
- uses: rhysd/action-setup-vim@v1
with:
neovim: true
version: ${{ inputs.nvim_version }}
- name: Setup Lua
uses: leso-kn/gh-actions-lua@master
with:
luaVersion: "5.1"
- name: Setup LuaRocks
uses: hishamhm/gh-actions-luarocks@master
# FIXME: caching .luarocks doesn't set up the environment variables (PATH, LUA_PATH, ...) properly
# if: steps.cache-luarocks.outputs.cache-hit != 'true'
with:
luarocksVersion: ${{ inputs.luarocks_version }}
- name: Run 'before' script
if: ${{ inputs.before != '' }}
run: ${{ inputs.before }}
shell: bash
- name: Install busted and nlua
if: steps.cache-luarocks.outputs.cache-hit != 'true'
run: |
luarocks install busted --local
luarocks install nlua --local
shell: bash
- run: luarocks test --local
shell: bash