-
-
Notifications
You must be signed in to change notification settings - Fork 17
120 lines (102 loc) · 2.58 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
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
name: build
on:
push:
branches:
- master
pull_request:
branches: [ master ]
jobs:
test:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
lua-version: ["5.1", "5.2", "5.3", "5.4", "luajit-openresty"]
name: Lua ${{ matrix.lua-version }}
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Set up Lua ${{ matrix.lua-version }}
uses: leafo/[email protected]
with:
luaVersion: ${{ matrix.lua-version }}
- name: Set up luarocks
uses: leafo/[email protected]
- name: Install PCRE
run: |
sudo apt-get update
sudo apt-get install libpcre3 libpcre3-dev
- name: Install dependencies
run: |
until luarocks install lualogging
do
sleep 1
done
until luarocks install busted
do
sleep 1
done
until luarocks install busted-htest
do
sleep 1
done
until luarocks install cluacov
do
sleep 1
done
until luarocks install luacheck
do
sleep 1
done
until luarocks install luacov-coveralls
do
sleep 1
done
until luarocks install lrexlib-pcre2
do
sleep 1
done
until luarocks install luaposix
do
sleep 1
done
if [ ! -f lua_install/bin/luacheck ]; then luarocks install luacheck; fi
- name: Lint with Luacheck
run: luacheck .
- name: Run tests
run: busted tests -o htest
- name: Reporting test coverage
run: |
busted tests -c -v
luacov-coveralls -i src -e .luarocks
env:
COVERALLS_REPO_TOKEN: ${{ secrets.GITHUB_TOKEN }}
benchmark:
runs-on: ubuntu-latest
strategy:
fail-fast: false
name: Benchmark
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Set up LuaJIT
uses: leafo/[email protected]
with:
luaVersion: "luajit-openresty"
- name: Set up luarocks
uses: leafo/[email protected]
- name: Install PCRE
run: |
sudo apt-get update
sudo apt-get install libpcre3 libpcre3-dev
- name: Install dependencies
run: |
luarocks install lualogging
luarocks install lrexlib-pcre2
luarocks install luaposix
luarocks install luasocket
luarocks install busted
luarocks install busted-htest
- name: Run Benchmark
run: |
busted bench.lua -o htest