@@ -13,24 +13,76 @@ jobs:
1313 steps :
1414 - name : Checkout
1515 uses : actions/checkout@v5
16- - name : Install Requirements for Coverage Testing
16+ with :
17+ submodules : recursive
18+
19+ - name : Install Perl Dependencies and Coverage Tools
1720 run : |
18- apt update && apt install -y lcov gpg curl jq ca-certificates
19- - name : Building
21+ apt update && apt install -y curl jq ca-certificates python3-pip
22+ apt install -y lcov perl-modules
23+ apt install -y libcapture-tiny-perl libdatetime-perl libjson-perl libperlio-gzip-perl
24+ lcov --version
25+
26+ - name : Building with Coverage
2027 run : |
21- cmake -B build -DENABLE_COVERAGE=ON -DBUILD_TESTING=ON -DENABLE_MLALGO=ON -DENABLE_LIBXC=ON -DENABLE_LIBRI=ON -DENABLE_GOOGLEBENCH=ON -DENABLE_RAPIDJSON=ON
28+ rm -rf build/
29+ rm -f CMakeCache.txt
30+
31+ mkdir -p build
32+ chmod -R 755 build/
33+
34+ cmake -B build \
35+ -DENABLE_COVERAGE=ON \
36+ -DBUILD_TESTING=ON \
37+ -DENABLE_MLALGO=ON \
38+ -DENABLE_LIBXC=ON \
39+ -DENABLE_LIBRI=ON \
40+ -DENABLE_GOOGLEBENCH=ON \
41+ -DENABLE_RAPIDJSON=ON \
42+ -DCMAKE_BUILD_TYPE=Debug \
43+ -DCMAKE_CXX_FLAGS="--coverage -fprofile-arcs -ftest-coverage" \
44+ -DCMAKE_EXE_LINKER_FLAGS="--coverage"
2245 cmake --build build -j`nproc`
2346 cmake --install build
47+
2448 - name : Testing
2549 env :
2650 OMP_NUM_THREADS : 1
2751 run : |
28- cmake --build build --target test ARGS="-V --timeout 21600" || exit 0
52+ chmod -R 755 build/
53+ cmake --build build --target test ARGS="-V --timeout 21600" || echo "Some tests failed but continuing for coverage"
54+
55+ - name : Generate Coverage Data
56+ run : |
57+ cd build
58+
59+ lcov --directory . --capture --output-file coverage.info
60+
61+ lcov --remove coverage.info '/usr/*' '*/test/*' '*/external/*' '*/build/*' --output-file coverage.filtered.info
62+
63+ genhtml coverage.filtered.info --output-directory coverage-report
64+
65+ cd ..
66+
2967 - name : Upload Coverage to Codecov
3068 uses : codecov/codecov-action@v5
3169 if : ${{ ! cancelled() }}
3270 with :
3371 fail_ci_if_error : true
3472 token : ${{ secrets.CODECOV_TOKEN }}
35- skip_validation : true
73+ files : ./build/coverage.xml,./build/coverage.info
74+ directory : ./build/
75+ flags : unittests
76+ name : codecov-umbrella
3677 verbose : true
78+
79+ - name : Upload Coverage Report Artifact
80+ uses : actions/upload-artifact@v4
81+ if : always()
82+ with :
83+ name : coverage-report
84+ path : |
85+ build/coverage-report/
86+ build/coverage.info
87+ build/coverage.xml
88+ retention-days : 30
0 commit comments