Skip to content

Show requirements statistics and test results in documentation #26

Show requirements statistics and test results in documentation

Show requirements statistics and test results in documentation #26

Workflow file for this run

# *******************************************************************************
# 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]
release:
types: [created]
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
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/...)')"
- 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