-
Notifications
You must be signed in to change notification settings - Fork 7
52 lines (44 loc) · 1.52 KB
/
test.yaml
File metadata and controls
52 lines (44 loc) · 1.52 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
name: Linting and Tests
on: [push, pull_request]
jobs:
check:
runs-on: ubuntu-latest
steps:
- name: Check out the repo
uses: actions/checkout@v4
- name: Create build image name
run: |
echo "IMAGENAME_LC=${IMAGENAME,,}" >> ${GITHUB_ENV}
env:
IMAGENAME: '${{ github.repository }}'
- name: Build the Docker image
run: docker build .docker/alpine/ --tag ${IMAGENAME_LC}-test:lua-5.2
- name: Run linter
uses: addnab/docker-run-action@v3
with:
image: ${{ env.IMAGENAME_LC }}-test:lua-5.2
options: -v ${{ github.workspace }}:/github/workspace
run: |
echo "Static luacheck ljsocket.lua"
luacheck --config .luacheckrc \
ljsocket.lua
echo "Linting ljsocket.lua"
lualint -s ljsocket.lua
- name: Bytecode verification
uses: addnab/docker-run-action@v3
with:
image: ${{ env.IMAGENAME_LC }}-test:lua-5.2
options: -v ${{ github.workspace }}:/github/workspace
run: |
echo "Checking JIT bytecode for ljsocket.lua"
luajit -bl ljsocket.lua /dev/null
echo "Checking bytecode for ljsocket.lua"
luac -p ljsocket.lua
- name: Run unit tests
uses: addnab/docker-run-action@v3
with:
image: ${{ env.IMAGENAME_LC }}-test:lua-5.2
options: -v ${{ github.workspace }}:/github/workspace
run: |
lunit -i `which luajit` $(find test -name "*_test.lua")
luacov ljsocket.lua