Skip to content
Draft
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
40 changes: 40 additions & 0 deletions .github/workflows/deploy_docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,10 @@ on:
branches: [main]
paths:
- 'docs/**'
- 'tools/generate_code_analysis.py'
- 'tools/BUILD'
- 'quality/coverage.bazelrc'
- 'quality/static_analysis/**'
- '.github/workflows/deploy_docs.yml'
workflow_dispatch:

Expand Down Expand Up @@ -73,6 +77,23 @@ jobs:
echo "should_deploy=true" >> "$GITHUB_OUTPUT"
fi

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

- name: Generate Coverage Report
run: |
bazel run //tools:generate_code_analysis -- --coverage

- name: Generate CodeQL Report
run: |
bazel run //tools:generate_code_analysis -- --codeql

- name: Generate Clang-Tidy Report
run: |
bazel run //tools:generate_code_analysis -- --clang-tidy

- name: Build Sphinx documentation
env:
DOCS_BASE_URL: "https://${{ github.repository_owner }}.github.io/${{ github.event.repository.name }}"
Expand Down Expand Up @@ -149,6 +170,24 @@ jobs:
fi
done

# Inject shared CSS/JS into old versions that lack them
REPO_NAME="${{ github.event.repository.name }}"
CUSTOM_CSS="<link rel=\"stylesheet\" type=\"text/css\" href=\"/${REPO_NAME}/_shared/css/default_custom.css\" />"
FLYOUT_CSS="<link rel=\"stylesheet\" type=\"text/css\" href=\"/${REPO_NAME}/_shared/css/version_flyout.css\" />"
FLYOUT_JS="<script src=\"/${REPO_NAME}/_shared/js/version_flyout.js\"></script>"
for dir in publish/v*/; do
[ -d "$dir" ] || continue
while IFS= read -r -d '' f; do
if ! grep -q 'default_custom' "$f"; then
sed -i "s|</head>|${CUSTOM_CSS}\n</head>|" "$f"
fi
if ! grep -q 'version_flyout' "$f"; then
sed -i "s|</head>|${FLYOUT_CSS}\n</head>|" "$f"
sed -i "s|</body>|${FLYOUT_JS}\n</body>|" "$f"
fi
done < <(find "$dir" -name '*.html' -print0)
done

# stable = newest tagged version that has docs
if [[ "${IS_TAG}" == "true" ]]; then
rm -rf publish/stable
Expand All @@ -163,6 +202,7 @@ jobs:

# Shared assets
mkdir -p publish/_shared/css publish/_shared/js
cp docs/sphinx/_static/css/default_custom.css publish/_shared/css/
cp docs/sphinx/_static/css/version_flyout.css publish/_shared/css/
cp docs/sphinx/_static/js/version_flyout.js publish/_shared/js/

Expand Down
5 changes: 5 additions & 0 deletions bazel/toolchains/template/conf.template.py
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,11 @@

# -- Options for HTML output --
html_theme = 'pydata_sphinx_theme'
html_static_path = ["_static"]
html_css_files = [
"css/default_custom.css",
]
html_js_files = []

# Professional theme configuration inspired by modern open-source projects
html_theme_options = {
Expand Down
8 changes: 6 additions & 2 deletions docs/sphinx/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ sphinx_docs_library(
)

# Static assets for Sphinx documentation
filegroup(
sphinx_docs_library(
name = "static_assets",
srcs = glob(["_static/**/*"]),
)
Expand All @@ -52,16 +52,20 @@ sphinx_module(
testonly = True,
srcs =
[
"code_analysis.rst",
"code_analysis/clang_tidy.rst",
"code_analysis/codeql.rst",
"code_analysis/coverage.rst",
"how_to_document.rst",
"index.rst",
"introduction.rst",
"message_passing.rst",
"safety_reports.rst",
":doxygen_xml",
":generate_api_rst",
":static_assets",
],
docs_library_deps = [
":static_assets",
"//score/mw/com:readme_md",
],
exec_compatible_with = ["@platforms//os:linux"],
Expand Down
2 changes: 2 additions & 0 deletions docs/sphinx/_static/codeanalysis/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
*
!.gitignore
15 changes: 15 additions & 0 deletions docs/sphinx/code_analysis.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
Code Analysis Reports
=====================

This section links to locally generated code-quality reports for coverage,
CodeQL, and clang-tidy.

.. note::
Run ``tools/generate_code_analysis.sh`` to generate reports locally.

.. toctree::
:maxdepth: 1

code_analysis/coverage
code_analysis/codeql
code_analysis/clang_tidy
14 changes: 14 additions & 0 deletions docs/sphinx/code_analysis/clang_tidy.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
Clang-Tidy Report
=================

clang-tidy analysis runs via ``bazel test --config=clang-tidy`` and its lint
outputs are collected into an HTML summary.

.. note::
Run ``tools/generate_code_analysis.sh --clang-tidy`` to generate reports locally.

Generated HTML report:

`Open clang-tidy report <../_static/codeanalysis/clang_tidy/index.html>`_

If the report has not been generated yet, the link points to a placeholder page.
14 changes: 14 additions & 0 deletions docs/sphinx/code_analysis/codeql.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
CodeQL Report
=============

CodeQL analysis runs via ``//quality/static_analysis:codeql_lint`` and produces
SARIF output that is converted to an HTML summary.

.. note::
Run ``tools/generate_code_analysis.sh --codeql`` to generate reports locally.

Generated HTML report:

`Open CodeQL report <../_static/codeanalysis/codeql/index.html>`_

If the report has not been generated yet, the link points to a placeholder page.
14 changes: 14 additions & 0 deletions docs/sphinx/code_analysis/coverage.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
Coverage Report
===============

Coverage is generated from ``bazel coverage //...`` and rendered with
``genhtml``.

.. note::
Run ``tools/generate_code_analysis.sh --coverage`` to generate reports locally.

Generated HTML report:

`Open coverage report <../_static/codeanalysis/coverage/index.html>`_

If the report has not been generated yet, the link points to a placeholder page.
1 change: 1 addition & 0 deletions docs/sphinx/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ including the LoLa (Low Latency) implementation and Message Passing library.
introduction
README
message_passing
code_analysis
how_to_document

.. toctree::
Expand Down
2 changes: 1 addition & 1 deletion quality/static_analysis/static_analysis.bazelrc
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@

# Clang-tidy configuration
# Run clang-tidy on all C++ targets with: bazel test --config=clang-tidy //...
test:clang-tidy --aspects=//:tools/lint/linters.bzl%clang_tidy_aspect
test:clang-tidy --aspects=//tools:lint/linters.bzl%clang_tidy_aspect
test:clang-tidy --output_groups=+rules_lint_report
# Use LLVM toolchain for clang-tidy so it can find system headers
test:clang-tidy --extra_toolchains=@llvm_toolchain//:cc-toolchain-x86_64-linux
Expand Down
19 changes: 19 additions & 0 deletions tools/BUILD
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# *******************************************************************************
# 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
# *******************************************************************************

py_binary(
name = "generate_code_analysis",
srcs = ["generate_code_analysis.py"],
main = "generate_code_analysis.py",
visibility = ["//visibility:public"],
)
Binary file not shown.
Loading
Loading