-
Notifications
You must be signed in to change notification settings - Fork 3
71 lines (68 loc) · 2.42 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
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
name: Testing with unit tests
on:
- push
- pull_request
jobs:
run-unit-tests:
runs-on: ubuntu-latest
strategy:
matrix:
version: ["1.10.15", "2.8.4", "2.10.6", "2.10.7-gc64-amd64", "2.11.2", "3.0.1"]
steps:
- uses: actions/checkout@v3
- uses: tarantool/setup-tarantool@v2
with:
tarantool-version: ${{matrix.version}}
- name: install luacov-console
run: tarantoolctl rocks install luacov-console
- name: install luacov-coveralls
run: tarantoolctl rocks install --server=http://luarocks.org luacov-coveralls
- name: setup perl
uses: shogo82148/actions-setup-perl@v1
with:
perl-version: 5.18.4
- name: show perl version
run: |
perl -v
- name: install TAP::Harness
run: |
cpanm -v
cpanm --notest TAP::Harness
- name: run tests
env:
LUACOV_ENABLE: true
run: |
make test
- name: rename luacov.stats.out
run: mv luacov.stats.out luacov.stats.out-${{matrix.version}}
- uses: actions/upload-artifact@master
with:
name: luacov.stats.out-${{matrix.version}}
path: luacov.stats.out-${{matrix.version}}
run-coverage-report:
runs-on: ubuntu-latest
needs: ["run-unit-tests"]
steps:
- uses: actions/checkout@master
- uses: tarantool/setup-tarantool@v2
with:
tarantool-version: '2.10.7'
- name: install luacov-coveralls 0.2.3
run: tarantoolctl rocks install --server=https://luarocks.org luacov-coveralls 0.2.3
- name: install luacov-console 1.2.0
run: tarantoolctl rocks --server http://moonlibs.github.io/rocks install luacov-console 1.2.0
- name: Download run artifacts
uses: actions/download-artifact@v4
with:
pattern: luacov.stats.out-*
merge-multiple: true
- name: debug
run: ls -la .
- name: merge luacov.stats.out
run: cat luacov.stats.out-* | >luacov.stats.out tarantool -e 'm={} for k in io.lines() do local vs=io.read():split(" ") vs[#vs]=nil local r = m[k] if r then for i, v in pairs(vs) do r[i]=r[i]+v end else m[k]=vs end end; for k, v in pairs(m) do print(k) print(table.concat(v, " ")) end'
- name: prepare coverage report
run: .rocks/bin/luacov-console . && .rocks/bin/luacov-console -s
- name: publish coveralls report
env:
COVERALLS_REPO_TOKEN: ${{ secrets.COVERALLS_REPO_TOKEN }}
run: .rocks/bin/luacov-coveralls -v