Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
95 changes: 16 additions & 79 deletions .github/workflows/code_coverage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,83 +24,20 @@ on:

jobs:
cpp:
runs-on: ubuntu-22.04
steps:
- name: Checkout Repository
uses: actions/checkout@v6

- name: Install lcov
run: |
sudo apt-get update
sudo apt-get install -y lcov

- name: Setup Bazel
uses: bazel-contrib/setup-bazel@0.18.0
with:
bazelisk-cache: true
disk-cache: ${{ github.workflow }}-${{ github.job }}
repository-cache: true
cache-save: ${{ github.event_name == 'push' }}

- name: Run Bazel Coverage
run: |
bazel coverage \
--test_output=errors \
--nocache_test_results \
--config=x86_64-linux \
//src/...

- name: Generate HTML Coverage Report
shell: bash
run: |
genhtml "$(bazel info output_path)/_coverage/_coverage_report.dat" \
-o=cpp_coverage \
--show-details \
--legend \
--function-coverage \
--branch-coverage

- name: Upload Coverage Artifacts
uses: actions/upload-artifact@v6
with:
name: ${{ github.event.repository.name }}_cpp_coverage_report
path: cpp_coverage/
retention-days: 10
uses: eclipse-score/cicd-workflows/.github/workflows/cpp-coverage.yml@main
with:
bazel-target: "//src/..."
bazel-config: "x86_64-linux"
extra-bazel-flags: "--test_output=errors --nocache_test_results"
artifact-name-suffix: "_cpp"
retention-days: 10
min-coverage: 76
rust:
runs-on: ubuntu-latest
steps:
- name: Checkout Repository
uses: actions/checkout@v6

- name: Setup Bazel
uses: bazel-contrib/setup-bazel@0.18.0
with:
bazelisk-cache: true
disk-cache: ${{ github.workflow }}-${{ github.job }}
repository-cache: true
cache-save: ${{ github.event_name == 'push' }}

- name: Run Rust tests with coverage instrumentation
run: |
set -euo pipefail
bazel test \
--config=x86_64-linux \
--config=ferrocene-coverage \
--nocache_test_results \
$(bazel query 'kind(rust_test, //src/...) except attr("tags", "loom", //src/...)')

- name: Generate Ferrocene coverage reports
run: |
set -euo pipefail
bazel run //:rust_coverage -- --min-line-coverage 66

- name: Locate coverage artifacts
run: |
echo "COVERAGE_DIR=$(bazel info bazel-bin)/coverage/rust-tests" >> "${GITHUB_ENV}"

- name: Upload coverage HTML
uses: actions/upload-artifact@v4
with:
name: ${{ github.event.repository.name }}_rust_coverage_report
path: ${{ env.COVERAGE_DIR }}
retention-days: 10
uses: eclipse-score/cicd-workflows/.github/workflows/rust-coverage.yml@main
with:
bazel-test-targets: "//src/..."
bazel-test-config-flags: "--config=x86_64-linux --config=ferrocene-coverage"
bazel-test-args: "--test_output=errors --nocache_test_results"
coverage-target: "//:rust_coverage"
coverage-artifact-name: "rust-coverage-html"
min-coverage: 93
Loading