Skip to content

Commit 6dd4e1f

Browse files
[cicd] use cmake in coverage build (#327)
1 parent 24aa252 commit 6dd4e1f

File tree

1 file changed

+21
-37
lines changed

1 file changed

+21
-37
lines changed

.github/workflows/deploy_test_coverage_coveralls.yml

+21-37
Original file line numberDiff line numberDiff line change
@@ -12,53 +12,37 @@ jobs:
1212
steps:
1313
- name: Checkout
1414
uses: actions/checkout@v3.1.0
15-
- name: Install
16-
run: |
17-
sudo apt install gcc-12 g++-12 lcov
18-
( cd /tmp
19-
git clone --depth 1 "https://gitlab.com/libeigen/eigen"
20-
cmake -S "eigen" -B "eigen/build"
21-
cmake --build "eigen/build" --parallel 4
22-
sudo cmake --install "eigen/build" )
23-
( cd /tmp
24-
git clone --depth 1 "https://github.com/fmtlib/fmt"
25-
cmake -S "fmt" -B "fmt/build"
26-
cmake --build "fmt/build" --parallel 4
27-
sudo cmake --install "fmt/build" )
28-
( cd /tmp
29-
git clone --depth 1 "https://github.com/kokkos/mdspan"
30-
cmake -S "mdspan" -B "mdspan/build"
31-
cmake --build "mdspan/build" --parallel 4
32-
sudo cmake --install "mdspan/build" )
33-
( cd /tmp
34-
git clone --depth 1 "https://github.com/kokkos/stdblas"
35-
cmake -S "stdblas" -B "stdblas/build"
36-
cmake --build "stdblas/build" --parallel 4
37-
sudo cmake --install "stdblas/build" )
38-
- name: Build
39-
run: |
40-
gcc-12 \
41-
sample/*.cpp source/*.cpp test/*.cpp \
42-
-Iinclude -I/usr/local/include/eigen3 -Isupport \
43-
-O0 -g -std=c++23 -fmodules-ts --coverage -fno-inline -fno-exceptions -lstdc++ -lm -lfmt
15+
- name: "Install"
16+
run: sudo apt install lcov
17+
- name: "Configure"
18+
env:
19+
CXX: "g++-12"
20+
CXXFLAGS: "-O0 -g --coverage -fno-inline -fno-exceptions"
21+
run: cmake -S . -B "build"
22+
- name: "Build"
23+
run: cmake --build "build" --verbose --parallel 4
4424
- name: "Coverage: Base"
4525
run: |
4626
lcov --rc lcov_branch_coverage=1 --gcov-tool gcov-12 --capture --initial --directory . --output-file base.info
27+
lcov --rc lcov_branch_coverage=1 --gcov-tool gcov-12 --remove base.info '*/benchmark/*' --output-file base.info
28+
lcov --rc lcov_branch_coverage=1 --gcov-tool gcov-12 --remove base.info '*/build/*' --output-file base.info
29+
lcov --rc lcov_branch_coverage=1 --gcov-tool gcov-12 --remove base.info '*/sample/*' --output-file base.info
30+
lcov --rc lcov_branch_coverage=1 --gcov-tool gcov-12 --remove base.info '*/source/*' --output-file base.info
31+
lcov --rc lcov_branch_coverage=1 --gcov-tool gcov-12 --remove base.info '*/test/*' --output-file base.info
4732
lcov --rc lcov_branch_coverage=1 --gcov-tool gcov-12 --remove base.info '/usr/*' --output-file base.info
4833
lcov --rc lcov_branch_coverage=1 --gcov-tool gcov-12 --remove base.info '10' --output-file base.info
49-
lcov --rc lcov_branch_coverage=1 --gcov-tool gcov-12 --remove base.info '*/test/*' --output-file base.info
50-
lcov --rc lcov_branch_coverage=1 --gcov-tool gcov-12 --remove base.info '*/source/*' --output-file base.info
51-
lcov --rc lcov_branch_coverage=1 --gcov-tool gcov-12 --remove base.info '*/sample/*' --output-file base.info
52-
- name: run
53-
run: ./a.out
34+
- name: "Test"
35+
run: ctest --test-dir "build" --tests-regex "kalman_(test|sample)" --verbose --parallel 4
5436
- name: "Coverage: Test"
5537
run: |
5638
lcov --rc lcov_branch_coverage=1 --gcov-tool gcov-12 --capture --directory . --output-file test.info
39+
lcov --rc lcov_branch_coverage=1 --gcov-tool gcov-12 --remove test.info '*/benchmark/*' --output-file test.info
40+
lcov --rc lcov_branch_coverage=1 --gcov-tool gcov-12 --remove test.info '*/build/*' --output-file test.info
41+
lcov --rc lcov_branch_coverage=1 --gcov-tool gcov-12 --remove test.info '*/sample/*' --output-file test.info
42+
lcov --rc lcov_branch_coverage=1 --gcov-tool gcov-12 --remove test.info '*/source/*' --output-file test.info
43+
lcov --rc lcov_branch_coverage=1 --gcov-tool gcov-12 --remove test.info '*/test/*' --output-file test.info
5744
lcov --rc lcov_branch_coverage=1 --gcov-tool gcov-12 --remove test.info '/usr/*' --output-file test.info
5845
lcov --rc lcov_branch_coverage=1 --gcov-tool gcov-12 --remove test.info '10' --output-file test.info
59-
lcov --rc lcov_branch_coverage=1 --gcov-tool gcov-12 --remove test.info '*/test/*' --output-file test.info
60-
lcov --rc lcov_branch_coverage=1 --gcov-tool gcov-12 --remove test.info '*/source/*' --output-file test.info
61-
lcov --rc lcov_branch_coverage=1 --gcov-tool gcov-12 --remove test.info '*/sample/*' --output-file test.info
6246
- name: "Coverage: Results"
6347
run: lcov --rc lcov_branch_coverage=1 --gcov-tool gcov-12 --rc lcov_branch_coverage=1 --add-tracefile base.info --add-tracefile test.info --output-file coverage.info
6448
- name: Coveralls

0 commit comments

Comments
 (0)