Ci: fix coverage (#331)

This commit is contained in:
ZeFeng Yin
2026-04-10 11:37:24 +08:00
committed by GitHub
parent 30a20e14b0
commit 725519516d
3 changed files with 12 additions and 5 deletions
+9 -3
View File
@@ -24,7 +24,7 @@ jobs:
- name: Checkout code
uses: actions/checkout@v6
with:
ref: main # Always use main for nightly
ref: main # Always use main for nightly
submodules: recursive
- name: Set up Python
@@ -45,9 +45,16 @@ jobs:
echo "$(python -c 'import site; print(site.USER_BASE)')/bin" >> $GITHUB_PATH
shell: bash
- name: Install system dependencies
run: |
sudo apt-get update
sudo apt-get install -y lcov
shell: bash
- name: Install dependencies
run: |
python -m pip install --upgrade pip \
pybind11==3.0 \
cmake==3.30.0 \
ninja==1.11.1 \
pytest \
@@ -64,8 +71,7 @@ jobs:
CMAKE_BUILD_PARALLEL_LEVEL="$NPROC" \
python -m pip install -v . \
--no-build-isolation \
--config-settings="cmake.build-type=COVERAGE" \
--config-settings='cmake.define.ENABLE_ZEN3="ON"'
--config-settings="cmake.build-type=COVERAGE"
shell: bash
- name: Run Python Tests with Coverage
+1
View File
@@ -463,6 +463,7 @@ set(
"$<$<CONFIG:COVERAGE>:$<$<CXX_COMPILER_ID:Clang>:--coverage>>"
"$<$<CONFIG:COVERAGE>:$<$<CXX_COMPILER_ID:AppleClang>:--coverage>>"
"$<$<CONFIG:COVERAGE>:$<$<CXX_COMPILER_ID:GNU>:--coverage>>"
"$<$<CONFIG:COVERAGE>:-fprofile-update=atomic>"
)
# C/C++ strict compile flags
+2 -2
View File
@@ -26,8 +26,8 @@ while getopts t:p:o:zk option; do
done
# Process sources
lcov -c -b "$source_base" -d . -o $project_name.lcov.info --gcov-tool=$gcov_tool --no-external || exit 1
eval $(echo lcov -r $project_name.lcov.info -o $project_name-filtered.lcov.info $filter_list) || exit 1
lcov -c -b "$source_base" -d . -o $project_name.lcov.info --gcov-tool=$gcov_tool --no-external --keep-going --ignore-errors unused,mismatch || exit 1
eval $(echo lcov -r $project_name.lcov.info -o $project_name-filtered.lcov.info $filter_list --ignore-errors unused,mismatch) || exit 1
# Gather HTML files
genhtml -t "$project_name" -o $output_name $project_name-filtered.lcov.info || exit 1