-
Notifications
You must be signed in to change notification settings - Fork 10
116 lines (92 loc) · 2.47 KB
/
test.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
name: test
on:
pull_request:
paths-ignore:
- '**/*.md'
push:
branches:
- main
paths-ignore:
- '**/*.md'
jobs:
lua:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
luaVersion: [ "5.2", "5.3", "5.4", "luajit-2.1.0-beta3", "luajit-openresty" ]
steps:
- name: checkout source code
uses: actions/checkout@v3
- name: install Lua/LuaJIT
uses: leafo/gh-actions-lua@v8
with:
luaVersion: ${{ matrix.luaVersion }}
- name: install LuaRocks
uses: leafo/gh-actions-luarocks@v4
- name: install dependencies
run: |
luarocks install busted
luarocks install luacov-coveralls
- name: build
run: |
make install
- name: run tests
run: |
make test-coverage
- name: samples
run: |
lua examples/example.lua
lua examples/custom-matcher.lua
lua examples/regular-expression.lua
- name: report test coverage
if: success()
continue-on-error: true
run: luacov-coveralls
env:
COVERALLS_REPO_TOKEN: ${{ github.token }}
- name: benchmark
run: |
make bench CMD=lua
openresty:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
openrestyVersion: [ "1.19.9.1", "1.21.4.3", "1.25.3.1" ]
steps:
- name: checkout source code
uses: actions/checkout@v3
- name: install Lua/LuaJIT
uses: leafo/gh-actions-lua@v8
with:
luaVersion: "luajit-openresty"
- uses: leafo/gh-actions-openresty@v1
with:
openrestyVersion: ${{ matrix.openrestyVersion }}
- name: install LuaRocks
uses: leafo/gh-actions-luarocks@v4
- name: install dependencies
run: |
luarocks install busted
luarocks install luacov-coveralls
- name: build
run: |
make install
- name: run tests
run: |
bin/resty_busted --coverage spec/
- name: samples
run: |
resty examples/example.lua
resty examples/custom-matcher.lua
resty examples/regular-expression.lua
- name: report test coverage
if: success()
continue-on-error: true
run: luacov-coveralls
env:
COVERALLS_REPO_TOKEN: ${{ github.token }}
- name: benchmark
run: |
make bench CMD=resty