Skip to content

Commit 82eca97

Browse files
committed
ci: Add coverage reports to ci and Makefile
Signed-off-by: Jakub Jelen <jjelen@redhat.com>
1 parent 5194dc4 commit 82eca97

File tree

2 files changed

+51
-0
lines changed

2 files changed

+51
-0
lines changed

.github/workflows/coverage.yml

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
---
2+
name: coverage
3+
4+
on:
5+
push:
6+
branches: ["main"]
7+
pull_request:
8+
branches: ["main"]
9+
10+
jobs:
11+
scan:
12+
name: Coverage report
13+
runs-on: ubuntu-22.04
14+
container: quay.io/fedora/fedora:latest
15+
steps:
16+
- name: Checkout Repository
17+
uses: actions/checkout@v4
18+
19+
- name: Install Dependencies
20+
run: |
21+
dnf -y install git clang gcc meson which pkgconf-pkg-config \
22+
openssl-devel openssl diffutils expect opensc python3-six \
23+
nss-softokn nss-tools nss-softokn-devel nss-devel softhsm \
24+
p11-kit-devel kryoptic gcovr lcov
25+
26+
- name: Setup
27+
run: |
28+
git config --global --add safe.directory \
29+
/__w/pkcs11-provider/pkcs11-provider
30+
git submodule update --init
31+
32+
- name: Run coverage report
33+
run: |
34+
meson setup builddir -Db_coverage=true
35+
meson compile -C builddir
36+
meson test -C builddir
37+
ninja -C builddir coverage
38+
39+
- uses: actions/upload-artifact@v4
40+
if: failure()
41+
with:
42+
name: Test valgrind logs ${{ matrix.name }}, ${{ matrix.compiler }}, ${{ matrix.token }} - ${{ steps.setup.cpu }}
43+
path: |
44+
builddir/meson-logs/coveragereport/

Makefile

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,3 +59,10 @@ dist:
5959
meson compile -C distdir pkcs11
6060
meson test -C distdir
6161
meson dist -C distdir
62+
63+
coverage:
64+
meson configure builddir -Db_coverage=true
65+
meson compile -C builddir --clean
66+
meson compile -C builddir
67+
meson test -C builddir
68+
ninja -C builddir coverage-html

0 commit comments

Comments
 (0)