Skip to content

Commit bd73864

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

File tree

2 files changed

+50
-0
lines changed

2 files changed

+50
-0
lines changed

.github/workflows/coverage.yml

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
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: Install Dependencies
17+
run: |
18+
dnf -y install git clang gcc meson which pkgconf-pkg-config \
19+
openssl-devel openssl diffutils expect opensc python3-six \
20+
nss-softokn nss-tools nss-softokn-devel nss-devel softhsm \
21+
p11-kit-devel kryoptic gcovr lcov
22+
23+
- name: Checkout Repository
24+
uses: actions/checkout@v4
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+
meson setup builddir -Db_coverage=true
32+
33+
- name: Build, test and generate coverage reports
34+
run: |
35+
meson compile -C builddir
36+
meson test -C builddir
37+
ninja -C builddir coverage
38+
39+
- uses: actions/upload-artifact@v4
40+
with:
41+
name: Test valgrind logs ${{ matrix.name }}, ${{ matrix.compiler }}, ${{ matrix.token }} - ${{ steps.setup.cpu }}
42+
path: |
43+
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)