-
Notifications
You must be signed in to change notification settings - Fork 1
66 lines (56 loc) · 1.6 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
name: "Test"
on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
jobs:
test:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
kongVersion:
- "2.8.x"
- "3.0.x"
- "dev"
- "3.0.0.x"
- "dev-ee"
steps:
- uses: actions/checkout@v4
- name: Clone kong-pongo
run: git clone https://github.com/nawaz1991/kong-pongo.git
- name: Setup env
run: |
PATH=$PATH:~/.local/bin
mkdir -p ~/.local/bin
ln -s $(realpath kong-pongo/pongo.sh) ~/.local/bin/pongo
- run: pongo run -- --coverage
# Optional upload of coverage data,
# just ugly, something to fix...
- uses: leafo/gh-actions-lua@v10
if: success()
- uses: leafo/gh-actions-luarocks@v4
if: success()
- name: Report test coverage
if: success()
continue-on-error: true
run: |
luarocks install luacov-coveralls
# hack: luacov config file has a path for inside the pongo container
# rewrite those to the local location in GHA
if [ -f .luacov ]; then
cp .luacov .luacov_backup
cat .luacov_backup | sed 's/\/kong-plugin-oasvalidator\/luacov./luacov./' > .luacov
else
echo "No .luacov file found"
fi
echo "Uploading luacov to coveralls.io"
luacov-coveralls
#luacov-coveralls --output coveralls.out
# undo the hack
if [ -f .luacov_backup ]; then
mv .luacov_backup .luacov
fi
env:
COVERALLS_REPO_TOKEN: ${{ github.CODECOV_TOKEN }}