-
-
Notifications
You must be signed in to change notification settings - Fork 107
133 lines (121 loc) · 3.63 KB
/
pr_check.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
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
name: Pull request check
on:
push:
# pull_request:
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
tests_foo:
uses: ./.github/workflows/tests.yml
with:
matrix: |
[
{"rev": "nightly/nvim-linux64.tar.gz"},
{"rev": "v0.9.2/nvim-linux64.tar.gz"}
]
tests:
name: unit tests
runs-on: ubuntu-22.04
strategy:
fail-fast: false
matrix:
include:
- version: nightly
rev: nightly/nvim-linux64.tar.gz
- version: stable
rev: v0.9.2/nvim-linux64.tar.gz
steps:
- uses: actions/checkout@v3
- run: date +%F > todays-date
- name: Restore cache for today's nightly.
uses: actions/cache@v3
with:
path: _neovim
key: ${{ matrix.rev }}-${{ hashFiles('todays-date') }}
- name: Prepare
run: |
test -d _neovim || {
mkdir -p _neovim
curl -sL "https://github.com/neovim/neovim/releases/download/${{ matrix.rev }}" | tar xzf - --strip-components=1 -C "${PWD}/_neovim"
}
- name: Run tests
run: |
export PATH="${PWD}/_neovim/bin:${PATH}"
export VIM="${PWD}/_neovim/share/nvim/runtime"
nvim --version
make test
lua-language-server:
name: lua language server
runs-on: ubuntu-22.04
strategy:
fail-fast: false
matrix:
include:
- version: nightly
rev: nightly/nvim-linux64.tar.gz
- version: stable
rev: v0.9.2/nvim-linux64.tar.gz
steps:
- uses: actions/checkout@v3
- run: date +%F > todays-date
- name: Restore cache for today's nightly.
uses: actions/cache@v3
with:
path: _neovim
key: ${{ matrix.rev }}-${{ hashFiles('todays-date') }}
- name: Restore vendor dependencies
uses: actions/cache@v3
with:
path: vendor
key: ${{ hashFiles('todays-date') }}
- name: Restore cache for lua LS
uses: actions/cache@v3
with:
path: _lua-ls
key: 3.7.0
- name: Prepare
run: |
test -d _neovim || {
mkdir -p _neovim
curl -sL "https://github.com/neovim/neovim/releases/download/${{ matrix.rev }}" | tar xzf - --strip-components=1 -C "${PWD}/_neovim"
}
test -d _lua-ls || {
mkdir -p _lua-ls
curl -sL "https://github.com/LuaLS/lua-language-server/releases/download/3.7.0/lua-language-server-3.7.0-linux-x64.tar.gz" | tar xzf - -C "${PWD}/_lua-ls"
}
- name: Run check
run: |
export PATH="${PWD}/_neovim/bin:${PATH}"
export PATH="${PWD}/_lua-ls/bin:${PATH}"
export VIM="${PWD}/_neovim/share/nvim/runtime"
nvim --version
make lua-language-server version=${{ matrix.version }}
stylua:
name: stylua
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v3
- uses: JohnnyMorganz/stylua-action@v3
with:
token: ${{ secrets.GITHUB_TOKEN }}
version: latest
args: --color always --check .
luacheck:
name: luacheck
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v3
- name: Prepare
run: |
sudo apt-get update
sudo apt-get install -y luarocks
sudo luarocks install luacheck
- name: Lint
run: sudo make luacheck
block-fixup:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v2
- name: Block Fixup Commit Merge
uses: 13rac1/[email protected]