Skip to content

Commit 7cea3fd

Browse files
committed
Add coverage workflow
1 parent 80feaae commit 7cea3fd

2 files changed

Lines changed: 39 additions & 8 deletions

File tree

.bazelrc

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -76,14 +76,16 @@ build:x86_64-linux --extra_toolchains=@score_toolchains_rust//toolchains/ferroce
7676
# With this instrumentation filter for our two main components, we ensure that `bazel coverage //...` is yielding the correct results
7777
coverage --config=x86_64-linux
7878
coverage --instrumentation_filter="^//score/datarouter[/:],^//score/mw/log[/:],-//score/mw/.*/test[/:]"
79-
coverage --experimental_generate_llvm_lcov
80-
coverage --experimental_use_llvm_covmap
79+
# Note: LLVM-specific flags - only use with LLVM/Clang toolchain
80+
# coverage --experimental_generate_llvm_lcov
81+
# coverage --experimental_use_llvm_covmap
82+
# coverage --test_env=LLVM_PROFILE_CONTINUOUS_MODE=1
83+
# coverage --cxxopt -mllvm
84+
# coverage --cxxopt -runtime-counter-relocation
85+
86+
# GCC-based coverage configuration
8187
coverage --combined_report=lcov
8288
coverage --coverage_report_generator=@bazel_tools//tools/test/CoverageOutputGenerator/java/com/google/devtools/coverageoutputgenerator:Main
8389
coverage --test_env=COVERAGE_GCOV_OPTIONS=-bcu
84-
# TODO set toolchain feature once possible
85-
# These compile time options are required to cover abnormal termination cases. In GCC one can use `__gcc_dump()`, but this does not work with LLVM
86-
# LLVM provided these compile-time options in combination with a specific profile setting which is enabled in bazel via `LLVM_PROFILE_CONTINUOUS_MODE`
87-
coverage --test_env=LLVM_PROFILE_CONTINUOUS_MODE=1
88-
coverage --cxxopt -mllvm
89-
coverage --cxxopt -runtime-counter-relocation
90+
coverage --features=coverage
91+
coverage --cache_test_results=no
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
# *******************************************************************************
2+
# Copyright (c) 2026 Contributors to the Eclipse Foundation
3+
#
4+
# See the NOTICE file(s) distributed with this work for additional
5+
# information regarding copyright ownership.
6+
#
7+
# This program and the accompanying materials are made available under the
8+
# terms of the Apache License Version 2.0 which is available at
9+
# https://www.apache.org/licenses/LICENSE-2.0
10+
#
11+
# SPDX-License-Identifier: Apache-2.0
12+
# *******************************************************************************
13+
14+
name: Code Coverage
15+
16+
on:
17+
pull_request:
18+
types: [opened, reopened, synchronize]
19+
push:
20+
branches:
21+
- main
22+
merge_group:
23+
types: [checks_requested]
24+
25+
jobs:
26+
coverage-report:
27+
uses: eclipse-score/cicd-workflows/.github/workflows/cpp-coverage.yml@main
28+
with:
29+
bazel-target: "//..."

0 commit comments

Comments
 (0)