Skip to content

Commit 0457dd7

Browse files
committed
add coverage job
1 parent fabe592 commit 0457dd7

File tree

5 files changed

+118
-11
lines changed

5 files changed

+118
-11
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:

README.adoc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
= {name}
44

55
|====
6-
| link:https://github.com/cppfw/{name}/releases[image:https://img.shields.io/github/tag/cppfw/{name}.svg[releases]] | link:https://github.com/cppfw/{name}/actions[image:https://github.com/cppfw/{name}/workflows/ci/badge.svg[ci status]]
6+
| link:https://github.com/cppfw/{name}/releases[image:https://img.shields.io/github/tag/cppfw/{name}.svg[releases]] | link:https://github.com/cppfw/{name}/actions[image:https://github.com/cppfw/{name}/workflows/ci/badge.svg[ci status]] | link:https://codecov.io/gh/cppfw/{name}[image:https://codecov.io/gh/cppfw/{name}/branch/main/graph/badge.svg?token=vwqhr1CujV[codecov.io]]
77
|====
88

99
OpenGL renderer for ruis

build/debian/control.in

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,11 +50,11 @@ Depends:
5050
${misc:Depends}
5151
Suggests: libruis-render-opengl-doc
5252
Description: OpenGL renderer for ruis.
53-
OpenGL renderer for ruis GUI library.
53+
OpenGL renderer for ruis GUI library.
5454

5555
Package: libruis-render-opengl-doc
5656
Section: doc
5757
Architecture: all
5858
Depends: ${misc:Depends}
5959
Description: documentation for libruis-render-opengl library.
60-
For more details see description to libruis-render-opengl-dev package.
60+
For more details see description to libruis-render-opengl-dev package.

src/makefile

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -14,18 +14,18 @@ this_soname := $(shell cat $(d)soname.txt)
1414
this_srcs += $(call prorab-src-dir, $(this_src_dir))
1515

1616
ifeq ($(os), linux)
17-
this_ldlibs += -lGL
18-
this_ldlibs += -lGLEW
17+
this_ldlibs += -l GL
18+
this_ldlibs += -l GLEW
1919
else ifeq ($(os), windows)
20-
this_ldlibs += -lopengl32
21-
this_ldlibs += -lglew32
20+
this_ldlibs += -l opengl32
21+
this_ldlibs += -l glew32
2222
else ifeq ($(os), macosx)
23-
this_ldlibs += -lGLEW
23+
this_ldlibs += -l GLEW
2424
this_ldlibs += -framework OpenGL
2525
endif
2626

27-
this_ldlibs += -lruis$(this_dbg)
28-
this_ldlibs += -lutki$(this_dbg)
27+
this_ldlibs += -l ruis$(this_dbg)
28+
this_ldlibs += -l utki$(this_dbg)
2929

3030
$(eval $(prorab-build-lib))
3131

tool-configs

0 commit comments

Comments
 (0)