File tree Expand file tree Collapse file tree 2 files changed +71
-0
lines changed
Expand file tree Collapse file tree 2 files changed +71
-0
lines changed Original file line number Diff line number Diff line change @@ -63,3 +63,8 @@ build:bl-aarch64-qnx --incompatible_strict_action_env
6363build:bl-aarch64-qnx --platforms=@score_bazel_platforms//:aarch64-qnx-sdp_8.0.0-posix
6464build:bl-aarch64-qnx --extra_toolchains=@score_qcc_aarch64_toolchain//:aarch64-qnx-sdp_8.0.0-posix
6565test:bl-aarch64-qnx --config=bl_common
66+
67+ # Coverage configuration for C++
68+ coverage --features=coverage
69+ coverage --combined_report=lcov
70+ coverage --cache_test_results=no
Original file line number Diff line number Diff line change 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+ on :
16+ pull_request :
17+ types : [opened, reopened, synchronize]
18+ push :
19+ branches :
20+ - main
21+ merge_group :
22+ types : [checks_requested]
23+
24+ jobs :
25+ coverage-report :
26+ runs-on : ubuntu-22.04
27+
28+ permissions :
29+ contents : read
30+
31+ steps :
32+ - name : Checkout Repository
33+ 34+
35+ - name : Install lcov
36+ run : |
37+ sudo apt-get update
38+ sudo apt-get install -y lcov
39+
40+ - name : Setup Bazel
41+ uses :
bazel-contrib/[email protected] 42+ with :
43+ bazelisk-cache : true
44+ disk-cache : ${{ github.workflow }}
45+ repository-cache : true
46+ cache-save : ${{ github.event_name != 'pull_request' }}
47+
48+ - name : Run Bazel Coverage
49+ run : |
50+ bazel coverage --config=bl-x86_64-linux //score/result/...
51+
52+ - name : Generate HTML Coverage Report
53+ run : |
54+ genhtml "$(bazel info output_path)/_coverage/_coverage_report.dat" \
55+ -o=cpp_coverage \
56+ --show-details \
57+ --legend \
58+ --function-coverage \
59+ --branch-coverage
60+ shell : bash
61+
62+ - name : Upload Coverage Artifacts
63+ 64+ with :
65+ name : ${{ github.event.repository.name }}_coverage_report
66+ path : cpp_coverage/
You can’t perform that action at this time.
0 commit comments