Skip to content

Commit 6517dee

Browse files
committed
add coverage job
1 parent 174c175 commit 6517dee

File tree

5 files changed

+117
-9
lines changed

5 files changed

+117
-9
lines changed

.github/workflows/ci.yml

Lines changed: 107 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,113 @@ env:
1313
MYCI_CONAN_USER: cppfw
1414
MYCI_CONAN_PASSWORD: ${{ secrets.MYCI_CONAN_PASSWORD }}
1515
jobs:
16+
##### coverage #####
17+
coverage:
18+
runs-on: ubuntu-latest
19+
container: debian:bookworm
20+
name: coverage - measure
21+
env:
22+
linux_distro: debian
23+
linux_release: bookworm
24+
steps:
25+
- name: add cppfw deb repo
26+
uses: myci-actions/add-deb-repo@main
27+
with:
28+
repo: deb https://gagis.hopto.org/repo/cppfw/${{ env.linux_distro }} ${{ env.linux_release }} main
29+
repo-name: cppfw
30+
keys-asc: https://gagis.hopto.org/repo/cppfw/pubkey.gpg
31+
install: myci locales git pipx
32+
- name: add llvm repo (for clang-format)
33+
uses: myci-actions/add-deb-repo@main
34+
with:
35+
repo: deb http://apt.llvm.org/${{ env.linux_release }} llvm-toolchain-${{ env.linux_release }} main
36+
repo-name: llvm
37+
keys-asc: https://apt.llvm.org/llvm-snapshot.gpg.key
38+
- name: git clone
39+
uses: myci-actions/checkout@main
40+
- name: prepare debian package
41+
run: myci-deb-prepare.sh
42+
- name: install deps
43+
run: myci-deb-install-build-deps.sh
44+
- name: add DE locale
45+
# needed for testing that locale with "," as decimal delimiter does not break the parsing with string_parser
46+
run: |
47+
echo "de_DE.UTF-8 UTF-8" >> /etc/locale.gen
48+
locale-gen
49+
- name: build
50+
run: make config=gcov
51+
- name: test
52+
run: make config=gcov test
53+
- name: generate coverage report
54+
# due to some bug in gcov, we need to use --gcov-ignore-parse-errors=negative_hits.warn
55+
run: pipx run gcovr --gcov-ignore-parse-errors=negative_hits.warn --exclude-throw-branches --filter src/ --cobertura > cobertura.xml
56+
- name: upload coverage report to artifacts
57+
uses: actions/upload-artifact@v4
58+
with:
59+
name: cobertura.xml
60+
path: cobertura.xml
61+
- name: upload coverage data to codecov.io
62+
uses: codecov/codecov-action@v5
63+
if: always() # even if previous steps fail, this one needs to be run
64+
with:
65+
token: ${{ secrets.CODECOV_TOKEN }}
66+
# do not search for coverage files automatically, upload only specified files
67+
disable_search: true
68+
files: cobertura.xml
69+
# flags: unittests # optional
70+
name: codecov-umbrella # optional
71+
fail_ci_if_error: true # optional (default = false)
72+
verbose: true # optional (default = false)
73+
- name: upload test report to codecov.io
74+
if: always() # even if previous steps fail, this one needs to be run
75+
uses: codecov/test-results-action@v1
76+
with:
77+
token: ${{ secrets.CODECOV_TOKEN }}
78+
# do not search for coverage files automatically, upload only specified files
79+
disable_search: true
80+
files: tests/unit/out/gcov/junit.xml
81+
name: codecov-umbrella # optional
82+
fail_ci_if_error: true # optional (default = false)
83+
verbose: true # optional (default = false)
84+
##### sanitizer #####
85+
sanitizer:
86+
strategy:
87+
fail-fast: false
88+
matrix:
89+
include:
90+
- {os: debian, codename: bookworm, image_owner: }
91+
- {os: debian, codename: bookworm, image_owner: arm32v7/, labels: [ubuntu-24.04-arm]}
92+
- {os: debian, codename: bookworm, image_owner: arm64v8/, labels: [ubuntu-24.04-arm]}
93+
runs-on: ${{ (matrix.labels == '' && 'ubuntu-latest') || matrix.labels }}
94+
container: ${{ matrix.image_owner }}${{ matrix.os }}:${{ matrix.codename }}
95+
name: sanitizer - ${{ matrix.image_owner }}${{ matrix.os }}:${{ matrix.codename }}
96+
steps:
97+
- name: add cppfw deb repo
98+
uses: myci-actions/add-deb-repo@main
99+
with:
100+
repo: deb https://gagis.hopto.org/repo/cppfw/${{ matrix.os }} ${{ matrix.codename }} main
101+
repo-name: cppfw
102+
keys-asc: https://gagis.hopto.org/repo/cppfw/pubkey.gpg
103+
install: myci git
104+
- name: add llvm repo (for clang-format)
105+
uses: myci-actions/add-deb-repo@main
106+
with:
107+
repo: deb http://apt.llvm.org/${{ matrix.codename }} llvm-toolchain-${{ matrix.codename }} main
108+
repo-name: llvm
109+
keys-asc: https://apt.llvm.org/llvm-snapshot.gpg.key
110+
- name: install ci tools
111+
run: |
112+
apt install --assume-yes devscripts equivs
113+
- name: git clone
114+
uses: myci-actions/checkout@main
115+
- name: prepare debian package
116+
run: myci-deb-prepare.sh
117+
- name: install deps
118+
run: myci-deb-install-build-deps.sh
119+
- name: build
120+
run: make config=asan
121+
- name: test
122+
run: make config=asan test
16123
##### deb linux #####
17124
deb:
18125
strategy:

build/debian/control.in

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,9 @@ Standards-Version: 3.9.2
1515
Package: libruis-render-null$(soname)
1616
Section: libs
1717
Architecture: any
18-
Depends: ${shlibs:Depends}, ${misc:Depends}
18+
Depends:
19+
${shlibs:Depends},
20+
${misc:Depends}
1921
Description: Null renderer for ruis.
2022
Null renderer for ruis GUI library.
2123

@@ -47,11 +49,11 @@ Depends:
4749
${misc:Depends}
4850
Suggests: libruis-render-null-doc
4951
Description: Null renderer for ruis.
50-
Null renderer for ruis GUI library.
52+
Null renderer for ruis GUI library.
5153

5254
Package: libruis-render-null-doc
5355
Section: doc
5456
Architecture: all
5557
Depends: ${misc:Depends}
5658
Description: documentation for libruis-render-null library.
57-
For more details see description to libruis-render-null-dev package.
59+
For more details see description to libruis-render-null-dev package.
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
usr/lib/libruis-render-null-dbg.so.*
1+
usr/lib/lib*-dbg.so.*

src/makefile

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,9 @@ this_soname := $(shell cat $(d)soname.txt)
1313

1414
this_srcs += $(call prorab-src-dir, $(this_src_dir))
1515

16-
# TODO: add linking to dbg versions of all libs
17-
this_ldlibs += -lruis$(this_dbg)
18-
this_ldlibs += -lutki$(this_dbg)
19-
this_ldlibs += -lrasterimage
16+
this_ldlibs += -l ruis$(this_dbg)
17+
this_ldlibs += -l utki$(this_dbg)
18+
this_ldlibs += -l rasterimage$(this_dbg)
2019

2120
$(eval $(prorab-build-lib))
2221

tool-configs

0 commit comments

Comments
 (0)