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
117 changes: 117 additions & 0 deletions .github/workflows/coverage.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,117 @@
# SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
# SPDX-License-Identifier: Apache-2.0

name: Coverage

on:
push:
branches: [ main, 'release/*.*.x' ]
pull_request:
workflow_dispatch:

# For PRs, cancel superseded coverage runs. For main/release pushes, let each
# published signal complete.
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: ${{ github.event_name == 'pull_request' }}

jobs:
ctest-coverage-ubuntu:
name: CTest coverage (Ubuntu)
runs-on: ubuntu-22.04
permissions:
contents: read
timeout-minutes: 45

steps:
- name: Checkout code
# actions/checkout@v6
uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10
with:
fetch-depth: 0
persist-credentials: false

- name: Install uv
uses: ./.github/actions/setup-uv

- name: Install Apt dependencies
run: |
sudo apt-get update
sudo apt-get install -y build-essential cmake ninja-build ccache gcovr clang-format-14 \
libx11-dev libvulkan-dev glslang-tools libxrandr-dev libxinerama-dev libxcursor-dev \
libxi-dev libxext-dev libxkbcommon-dev libwayland-dev wayland-protocols \
autoconf automake libtool pkg-config libudev-dev

- name: Configure coverage build
run: |
set -euo pipefail
cmake -S . -B build-coverage -G Ninja \
-DCMAKE_BUILD_TYPE=Debug \
-DISAAC_TELEOP_PYTHON_VERSION=3.11 \
-DBUILD_VIZ=OFF \
-DBUILD_PLUGINS=OFF \
-DBUILD_EXAMPLES=OFF \
-DBUNDLE_ROBOTIC_GROUNDING=OFF \
-DENABLE_CLOUDXR_BUNDLE_CHECK=OFF \
-DENABLE_CLANG_FORMAT_CHECK=OFF \
-DCMAKE_C_COMPILER_LAUNCHER=ccache \
-DCMAKE_CXX_COMPILER_LAUNCHER=ccache \
-DCMAKE_C_FLAGS="--coverage -O0 -g" \
-DCMAKE_CXX_FLAGS="--coverage -O0 -g" \
-DCMAKE_EXE_LINKER_FLAGS="--coverage" \
-DCMAKE_SHARED_LINKER_FLAGS="--coverage" \
-DCMAKE_MODULE_LINKER_FLAGS="--coverage"

- name: Build
run: cmake --build build-coverage --parallel 4

- name: Run CTest
run: ctest --test-dir build-coverage --output-on-failure --parallel 4

- name: Generate coverage report
run: |
set -euo pipefail
mkdir -p coverage/html

gcovr_args=(
--root "${GITHUB_WORKSPACE}"
--object-directory build-coverage/src
--filter "src/"
--exclude "src/.*/.*_tests/.*"
--exclude "src/.*/tests/.*"
--exclude "src/.*/python_tests/.*"
)

gcovr "${gcovr_args[@]}" --txt --output coverage/summary.txt --print-summary | tee coverage/totals.txt
gcovr "${gcovr_args[@]}" --xml-pretty --output coverage/cobertura.xml
gcovr "${gcovr_args[@]}" --html-details --output coverage/html/index.html

- name: Publish coverage summary
run: |
set -euo pipefail
{
echo "## CTest coverage"
echo
echo "Native coverage was generated from the Debug CTest build with plugins, examples, and Televiz disabled."
echo
echo "### Totals"
echo '```'
cat coverage/totals.txt
echo '```'
echo
echo "Download the \`isaacteleop-coverage\` artifact for the HTML report and \`coverage/cobertura.xml\`."
} >> "${GITHUB_STEP_SUMMARY}"

- name: Upload coverage artifact
if: ${{ always() }}
# actions/upload-artifact@v6

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: could add a comment that this pins to the 6.0.3 release of actions/checkout.

uses: actions/upload-artifact@b7c566a772e6b6bfb58ed0dc250532a479d7789f
with:
name: isaacteleop-coverage
path: |
coverage/summary.txt

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

just to confirm: is this the same coverage report format that NVIDIA's internal tooling expects?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Confirmed: the workflow generates Cobertura XML with gcovr --xml-pretty and now publishes it explicitly as coverage/cobertura.xml, alongside the HTML and text summaries in the isaacteleop-coverage artifact. If NVIDIA internal tooling expects a different filename/path in addition to Cobertura XML, I can add that too.

coverage/totals.txt
coverage/cobertura.xml
coverage/html
if-no-files-found: error
retention-days: 14
Loading