Make sure Codecov reports line coverage (#2698)
This commit is contained in:
17
.github/scripts/gcov_wrapper
vendored
Executable file
17
.github/scripts/gcov_wrapper
vendored
Executable file
@@ -0,0 +1,17 @@
|
||||
#!/bin/bash
|
||||
|
||||
# This script is used in linux-ci.yml.
|
||||
# Bazel 7 started including branch coverage in the coverage report.
|
||||
# Now codecov is reporting branch coverage instead of line coverage.
|
||||
# This script makes sure branch coverage is not included so codecov reports line coveage.
|
||||
|
||||
filtered_args=()
|
||||
|
||||
for arg in "$@"; do
|
||||
# Skip the argument if it's "-b"
|
||||
if [ "$arg" != "-b" ]; then
|
||||
filtered_args+=("$arg")
|
||||
fi
|
||||
done
|
||||
|
||||
gcov "${filtered_args[@]}"
|
||||
1
.github/workflows/linux-ci.yml
vendored
1
.github/workflows/linux-ci.yml
vendored
@@ -216,6 +216,7 @@ jobs:
|
||||
xvfb-run -a \
|
||||
bazel coverage --combined_report=lcov --instrumentation_filter="//:mbgl-core" \
|
||||
--test_output=errors --local_test_jobs=1 \
|
||||
--repo_env=GCOV="$PWD/.github/scripts/gcov_wrapper" \
|
||||
--test_env=DISPLAY --test_env=XAUTHORITY --copt="-DCI_BUILD" \
|
||||
//test:core //render-test:render-test //expression-test:test
|
||||
echo coverage_report="$(bazel info output_path)"/_coverage/_coverage_report.dat >> "$GITHUB_ENV"
|
||||
|
||||
Reference in New Issue
Block a user