-
Notifications
You must be signed in to change notification settings - Fork 230
51 lines (51 loc) · 1.67 KB
/
tests.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
name: Run Tests
on:
push:
pull_request:
schedule:
# Run tests weekly to make sure they keep working despite various
# dependency changes.
- cron: '23 06 * * 5'
workflow_dispatch: # allow running manually
jobs:
lua:
runs-on: ubuntu-latest
timeout-minutes: 10
strategy:
matrix:
lua: ["5.1", "5.2"]
steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@v2
- run: sudo apt install libpcre2-dev
- run: pip install hererocks
# Install latest LuaRocks version plus the Lua version for this build job
# into 'here' subdirectory.
- run: hererocks here -r^ --lua ${{ matrix.lua }}
- run: echo $PWD/here/bin >> $GITHUB_PATH
- run: eval `luarocks path --bin`
- run: luarocks install luacheck
- run: luarocks install luacov-coveralls
- run: luarocks install luaunit
- run: luarocks install lrexlib-pcre2
- run: luacheck --globals ngx -- prometheus.lua prometheus_keys.lua prometheus_resty_counter.lua
- run: luacheck --globals luaunit rex_pcre2 ngx TestPrometheus TestKeyIndex -- prometheus_test.lua
- run: lua -lluacov prometheus_test.lua
- run: luacov-coveralls --include ^prometheus
env:
COVERALLS_REPO_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# Only report test coverage for lua 5.1 to avoid doing it twice.
if: ${{ matrix.lua == '5.1' }}
integration:
runs-on: ubuntu-latest
timeout-minutes: 10
defaults:
run:
working-directory: integration
steps:
- uses: actions/checkout@v2
- uses: actions/setup-go@v2
with:
go-version: 1.14
- run: go get
- run: ./test.sh