Skip to content

Commit 6f2fe6f

Browse files
committed
feat: consolidate CI workflows and enhance test coverage reporting
1 parent c5e9fc2 commit 6f2fe6f

File tree

4 files changed

+57
-74
lines changed

4 files changed

+57
-74
lines changed

.github/workflows/ci.yml

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,3 +24,59 @@ jobs:
2424

2525
- name: Run tests
2626
run: cd build && ctest --output-on-failure
27+
28+
test-case-coverage:
29+
runs-on: ubuntu-latest
30+
steps:
31+
- name: Checkout code
32+
uses: actions/checkout@v4
33+
34+
- name: Install dependencies
35+
run: sudo apt-get update && sudo apt-get install -y cmake gcc lcov
36+
37+
- name: Configure CMake (with coverage flags)
38+
run: |
39+
cmake -B build -DCMAKE_BUILD_TYPE=Debug -DCMAKE_C_FLAGS="--coverage" -DCMAKE_EXE_LINKER_FLAGS="--coverage"
40+
41+
- name: Build
42+
run: cmake --build build
43+
44+
- name: Run tests
45+
run: |
46+
cd build && ctest --output-on-failure
47+
48+
- name: Generate coverage report
49+
run: |
50+
lcov --capture --directory build --output-file coverage.info
51+
lcov --remove coverage.info '*/Unity/*' '*/cJSON/*' --output-file coverage.info
52+
lcov --list coverage.info
53+
genhtml coverage.info --output-directory out
54+
55+
- name: Upload coverage artifact
56+
uses: actions/upload-artifact@v4
57+
with:
58+
name: coverage-report-html
59+
path: out
60+
61+
memory-check:
62+
runs-on: ubuntu-latest
63+
steps:
64+
- name: Checkout code
65+
uses: actions/checkout@v4
66+
67+
- name: Install dependencies
68+
run: sudo apt-get update && sudo apt-get install -y cmake gcc valgrind
69+
70+
- name: Configure CMake
71+
run: cmake -S . -B build
72+
73+
- name: Build
74+
run: cmake --build build
75+
76+
- name: Run tests with valgrind
77+
run: |
78+
cd output
79+
for t in mjsonrpc-example-*; do
80+
echo "Running valgrind on $t"
81+
valgrind --leak-check=full --error-exitcode=1 ./$t || exit 1
82+
done

.github/workflows/coverage.yml

Lines changed: 0 additions & 41 deletions
This file was deleted.

.github/workflows/docs.yml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: Generate Documentation
1+
name: Generate Doxygen Documentation
22

33
on:
44
push:
@@ -9,7 +9,6 @@ on:
99
jobs:
1010
docs:
1111
runs-on: ubuntu-latest
12-
1312
steps:
1413
- name: Checkout code
1514
uses: actions/checkout@v4

.github/workflows/memcheck.yml

Lines changed: 0 additions & 31 deletions
This file was deleted.

0 commit comments

Comments
 (0)