Skip to content
Merged
Show file tree
Hide file tree
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
54 changes: 53 additions & 1 deletion .github/workflows/deploy_docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,14 @@ on:
branches: [main]
paths:
- 'bazel/rules/rules_score/docs/**'
- 'coverage/**'
- '.github/workflows/deploy_docs.yml'
workflow_dispatch:
permissions:
contents: write # needed for uploading release assets
pages: write
id-token: write
pull-requests: write # needed for posting PR comments
concurrency:
group: "pages"
cancel-in-progress: false
Expand All @@ -46,7 +48,7 @@ jobs:
- name: Install system dependencies
run: |
sudo apt-get update
sudo apt-get install -y pkg-config libcairo2-dev
sudo apt-get install -y pkg-config libcairo2-dev lcov
- name: Determine version
id: version
run: |
Expand All @@ -63,6 +65,15 @@ jobs:
fi
- name: Build Sphinx documentation
run: bazel build //bazel/rules/rules_score:rules_score_doc
- name: Generate combined coverage report
id: coverage
run: |
COVERAGE_OUTPUT=$(bazel run //coverage:combined_report -- --out-dir coverage-html 2>&1)
echo "${COVERAGE_OUTPUT}"
LINES=$(echo "${COVERAGE_OUTPUT}" | grep -oP 'lines\.+: \K[\d.]+%' | head -1 | tr -d '\n' || echo 'N/A')
FUNCTIONS=$(echo "${COVERAGE_OUTPUT}" | grep -oP 'functions\.+: \K[\d.]+%' | head -1 | tr -d '\n' || echo 'N/A')
echo "lines=${LINES}" >> "$GITHUB_OUTPUT"
echo "functions=${FUNCTIONS}" >> "$GITHUB_OUTPUT"
- name: Prepare documentation output
run: |
BAZEL_BIN="$(bazel info bazel-bin)"
Expand All @@ -77,6 +88,12 @@ jobs:
cp -r "${HTML_DIR}/." docs_output/
chmod -R u+w docs_output/

# Embed the combined coverage report at docs_output/coverage/
if [[ -d coverage-html ]]; then
mkdir -p docs_output/coverage
cp -r coverage-html/. docs_output/coverage/
fi

# Prevent Jekyll from ignoring _static directories
touch docs_output/.nojekyll

Expand All @@ -94,6 +111,41 @@ jobs:
fi
echo "Documentation built successfully"
find docs_output -type f | wc -l | xargs -I{} echo "Total files: {}"
- name: Upload coverage report artifact
if: always()
id: upload-coverage
uses: actions/upload-artifact@v4
with:
name: coverage-report
path: coverage-html/
- name: Post coverage summary to PR
if: github.event_name == 'pull_request'
continue-on-error: true
uses: actions/github-script@v7
with:
script: |
const lines = '${{ steps.coverage.outputs.lines }}';
const functions = '${{ steps.coverage.outputs.functions }}';
const runUrl = `${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}`;
const body = [
'## Coverage Report',
'',
'Coverage report was generated.',
'',
`**Full report** can be downloaded from the [CI artifacts](${runUrl}) (expand **Artifacts** at the bottom of the run).`,
'',
'**Overall coverage rate:**',
'```',
`lines......: ${lines}`,
`functions......: ${functions}`,
'```'
].join('\n');
github.rest.issues.createComment({
issue_number: context.issue.number,
owner: context.repo.owner,
repo: context.repo.repo,
body: body
});
- name: Upload docs to release
if: startsWith(github.ref, 'refs/tags/v')
env:
Expand Down
1 change: 1 addition & 0 deletions bazel/rules/rules_score/docs/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -27,3 +27,4 @@ safety analysis to the top-level SEooC assembly.
integration_guide
user_guide/index
rule_reference
quality_report
29 changes: 29 additions & 0 deletions bazel/rules/rules_score/docs/quality_report.rst
Original file line number Diff line number Diff line change
@@ -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
# *******************************************************************************

Quality Report
==============

This section provides quality reports generated for the tooling repository.

Code Coverage
-------------

The combined Rust + Python HTML coverage report is generated using:

.. code-block:: bash

bazel run //coverage:combined_report

`View Coverage Report <coverage/index.html>`_
Loading