Ci: fix coverage (#331)
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user