-
Notifications
You must be signed in to change notification settings - Fork 35
50 lines (40 loc) · 1.32 KB
/
build.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
name: Automated Build
on:
pull_request:
push:
branches: [master]
jobs:
build:
name: Lint & Test
runs-on: ubuntu-latest
env:
lua-version: 5.1
steps:
- uses: actions/checkout@v4
- name: Install lua ${{ env.lua-version }} & luarocks
run: |
sudo apt update
sudo apt install lua${{ env.lua-version }} luarocks
# The lua-format library takes a while to compile, so we cache it
# Update the YYYYMMDD component of the cache key if you want to force an update
- name: Cache/restore ~/.luarocks directory
uses: actions/cache@v4
with:
path: ~/.luarocks
key: ${{ runner.os }}-cache-lua-rocks-${{ env.lua-version }}-20240606
- name: Install luacheck
run: |
if [[ ! -f ~/.luarocks/bin/luacheck ]]; then
luarocks --local install luacheck
fi
- name: Install lua-format
run: |
if [[ ! -f ~/.luarocks/bin/lua-format ]]; then
luarocks --local install https://raw.githubusercontent.com/Koihik/LuaFormatter/master/luaformatter-scm-1.rockspec
fi
- name: Lint sources
run: ./build.sh -v run-linter
- name: Run tests
run: ./build.sh -v run-tests
- name: Run format checks
run: ./build.sh -v check-formatter