Skip to content

Commit cea030c

Browse files
committed
Update CI workflow for C++ coverage generation and testing
1 parent 4688182 commit cea030c

File tree

1 file changed

+23
-1
lines changed

1 file changed

+23
-1
lines changed

.github/workflows/ci.yml

Lines changed: 23 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,29 @@ jobs:
3737
- name: Build package
3838
run: |
3939
python scripts/build/install.py
40-
40+
41+
- name: Build C++ Code with Coverage
42+
run: |
43+
mkdir build
44+
cd build
45+
cmake -DCMAKE_CXX_FLAGS="--coverage" ..
46+
make
47+
48+
- name: Run C++ Tests
49+
run: |
50+
cd build
51+
./test_binary
52+
# Capture and Generating Coverage Report with lcov
53+
- name: Capture Coverage Data with lcov
54+
run: |
55+
cd build
56+
lcov --capture --directory . --output-file coverage.info
57+
58+
- name: Generate HTML Coverage Report with genhtml
59+
run: |
60+
cd build
61+
genhtml coverage.info --output-directory coverage_report
62+
4163
- name: Run tests
4264
run: |
4365
python -m pytest --doctest-modules --cov=./ --cov-report=xml -s

0 commit comments

Comments
 (0)