From 7cea3fd8e9cd6d0d35a8d7d4ea2c7aa269bdee03 Mon Sep 17 00:00:00 2001 From: "rahul.singh" Date: Fri, 20 Feb 2026 09:21:06 +0100 Subject: [PATCH 1/4] Add coverage workflow --- .bazelrc | 18 +++++++++-------- .github/workflows/coverage_report.yml | 29 +++++++++++++++++++++++++++ 2 files changed, 39 insertions(+), 8 deletions(-) create mode 100644 .github/workflows/coverage_report.yml diff --git a/.bazelrc b/.bazelrc index 7bd1a8d..60efc87 100644 --- a/.bazelrc +++ b/.bazelrc @@ -76,14 +76,16 @@ build:x86_64-linux --extra_toolchains=@score_toolchains_rust//toolchains/ferroce # With this instrumentation filter for our two main components, we ensure that `bazel coverage //...` is yielding the correct results coverage --config=x86_64-linux coverage --instrumentation_filter="^//score/datarouter[/:],^//score/mw/log[/:],-//score/mw/.*/test[/:]" -coverage --experimental_generate_llvm_lcov -coverage --experimental_use_llvm_covmap +# Note: LLVM-specific flags - only use with LLVM/Clang toolchain +# coverage --experimental_generate_llvm_lcov +# coverage --experimental_use_llvm_covmap +# coverage --test_env=LLVM_PROFILE_CONTINUOUS_MODE=1 +# coverage --cxxopt -mllvm +# coverage --cxxopt -runtime-counter-relocation + +# GCC-based coverage configuration coverage --combined_report=lcov coverage --coverage_report_generator=@bazel_tools//tools/test/CoverageOutputGenerator/java/com/google/devtools/coverageoutputgenerator:Main coverage --test_env=COVERAGE_GCOV_OPTIONS=-bcu -# TODO set toolchain feature once possible -# 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 -# LLVM provided these compile-time options in combination with a specific profile setting which is enabled in bazel via `LLVM_PROFILE_CONTINUOUS_MODE` -coverage --test_env=LLVM_PROFILE_CONTINUOUS_MODE=1 -coverage --cxxopt -mllvm -coverage --cxxopt -runtime-counter-relocation +coverage --features=coverage +coverage --cache_test_results=no diff --git a/.github/workflows/coverage_report.yml b/.github/workflows/coverage_report.yml new file mode 100644 index 0000000..679cf0a --- /dev/null +++ b/.github/workflows/coverage_report.yml @@ -0,0 +1,29 @@ +# ******************************************************************************* +# Copyright (c) 2026 Contributors to the Eclipse Foundation +# +# See the NOTICE file(s) distributed with this work for additional +# information regarding copyright ownership. +# +# This program and the accompanying materials are made available under the +# terms of the Apache License Version 2.0 which is available at +# https://www.apache.org/licenses/LICENSE-2.0 +# +# SPDX-License-Identifier: Apache-2.0 +# ******************************************************************************* + +name: Code Coverage + +on: + pull_request: + types: [opened, reopened, synchronize] + push: + branches: + - main + merge_group: + types: [checks_requested] + +jobs: + coverage-report: + uses: eclipse-score/cicd-workflows/.github/workflows/cpp-coverage.yml@main + with: + bazel-target: "//..." From 2b49d10a7fa4d18a8eb9101e854bd81097852ca7 Mon Sep 17 00:00:00 2001 From: "rahul.singh" Date: Wed, 25 Feb 2026 05:47:17 +0100 Subject: [PATCH 2/4] Remove redundant coverage_report_generator flag --- .bazelrc | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/.bazelrc b/.bazelrc index 60efc87..a7eeebf 100644 --- a/.bazelrc +++ b/.bazelrc @@ -73,19 +73,16 @@ build:x86_64-linux --extra_toolchains=@score_toolchains_rust//toolchains/ferroce -# With this instrumentation filter for our two main components, we ensure that `bazel coverage //...` is yielding the correct results +# Coverage configuration for C++ coverage --config=x86_64-linux coverage --instrumentation_filter="^//score/datarouter[/:],^//score/mw/log[/:],-//score/mw/.*/test[/:]" -# Note: LLVM-specific flags - only use with LLVM/Clang toolchain + # coverage --experimental_generate_llvm_lcov # coverage --experimental_use_llvm_covmap # coverage --test_env=LLVM_PROFILE_CONTINUOUS_MODE=1 -# coverage --cxxopt -mllvm -# coverage --cxxopt -runtime-counter-relocation # GCC-based coverage configuration coverage --combined_report=lcov -coverage --coverage_report_generator=@bazel_tools//tools/test/CoverageOutputGenerator/java/com/google/devtools/coverageoutputgenerator:Main coverage --test_env=COVERAGE_GCOV_OPTIONS=-bcu coverage --features=coverage coverage --cache_test_results=no From 5aba26de9b11d8fd9550d99b4e25a7745fc19299 Mon Sep 17 00:00:00 2001 From: "rahul.singh" Date: Wed, 25 Feb 2026 09:40:32 +0100 Subject: [PATCH 3/4] Removing LLVM-related commented parts --- .bazelrc | 4 ---- 1 file changed, 4 deletions(-) diff --git a/.bazelrc b/.bazelrc index a7eeebf..aaf9466 100644 --- a/.bazelrc +++ b/.bazelrc @@ -77,10 +77,6 @@ build:x86_64-linux --extra_toolchains=@score_toolchains_rust//toolchains/ferroce coverage --config=x86_64-linux coverage --instrumentation_filter="^//score/datarouter[/:],^//score/mw/log[/:],-//score/mw/.*/test[/:]" -# coverage --experimental_generate_llvm_lcov -# coverage --experimental_use_llvm_covmap -# coverage --test_env=LLVM_PROFILE_CONTINUOUS_MODE=1 - # GCC-based coverage configuration coverage --combined_report=lcov coverage --test_env=COVERAGE_GCOV_OPTIONS=-bcu From 3b1aaca03131d91bce7e41113474a88ac3eebc40 Mon Sep 17 00:00:00 2001 From: "rahul.singh" Date: Wed, 25 Feb 2026 11:16:01 +0100 Subject: [PATCH 4/4] Remove redundant test workflow --- .github/workflows/coverage_report.yml | 2 +- .github/workflows/tests.yml | 42 --------------------------- 2 files changed, 1 insertion(+), 43 deletions(-) delete mode 100644 .github/workflows/tests.yml diff --git a/.github/workflows/coverage_report.yml b/.github/workflows/coverage_report.yml index 679cf0a..95d37cd 100644 --- a/.github/workflows/coverage_report.yml +++ b/.github/workflows/coverage_report.yml @@ -11,7 +11,7 @@ # SPDX-License-Identifier: Apache-2.0 # ******************************************************************************* -name: Code Coverage +name: CPP/C++ on: pull_request: diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml deleted file mode 100644 index c17fb8c..0000000 --- a/.github/workflows/tests.yml +++ /dev/null @@ -1,42 +0,0 @@ -# ******************************************************************************* -# Copyright (c) 2025 Contributors to the Eclipse Foundation -# -# See the NOTICE file(s) distributed with this work for additional -# information regarding copyright ownership. -# -# This program and the accompanying materials are made available under the -# terms of the Apache License Version 2.0 which is available at -# https://www.apache.org/licenses/LICENSE-2.0 -# -# SPDX-License-Identifier: Apache-2.0 -# ******************************************************************************* - -name: Bazel Tests - -on: - pull_request: - types: [opened, reopened, synchronize] - merge_group: - types: [checks_requested] -env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - -jobs: - setup-and-run-tests: - runs-on: ubuntu-latest - steps: - - name: Checkout repository - uses: actions/checkout@v4.2.2 - - - name: Setup Bazel with shared caching - uses: bazel-contrib/setup-bazel@0.15.0 - with: - bazelisk-version: 1.26.0 - disk-cache: true - repository-cache: true - bazelisk-cache: true - - - name: Run Tests via Bazel - run: | - echo "Running: bazel test //score/..." - bazel test --config x86_64-linux //score/...