From 3a39221e4b834e6bdac2291bbbc88235f6bfb8a0 Mon Sep 17 00:00:00 2001 From: Andrew Russell Date: Mon, 22 Jun 2026 23:02:19 -0400 Subject: [PATCH 1/2] Add GitHub coverage reporting workflow Signed-off-by: Andrew Russell --- .github/workflows/coverage.yml | 114 +++++++++++++++++++++++++++++++++ 1 file changed, 114 insertions(+) create mode 100644 .github/workflows/coverage.yml diff --git a/.github/workflows/coverage.yml b/.github/workflows/coverage.yml new file mode 100644 index 000000000..09a254a92 --- /dev/null +++ b/.github/workflows/coverage.yml @@ -0,0 +1,114 @@ +# 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 + uses: actions/checkout@v6 + with: + fetch-depth: 0 + + - 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/coverage.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 Cobertura XML." + } >> "${GITHUB_STEP_SUMMARY}" + + - name: Upload coverage artifact + if: ${{ always() }} + uses: actions/upload-artifact@v6 + with: + name: isaacteleop-coverage + path: | + coverage/summary.txt + coverage/totals.txt + coverage/coverage.xml + coverage/html + if-no-files-found: warn + retention-days: 14 From 2dc9c2e2142205fc1b09936906837bad7580d994 Mon Sep 17 00:00:00 2001 From: Andrew Russell Date: Wed, 24 Jun 2026 13:18:54 -0400 Subject: [PATCH 2/2] Address coverage workflow review feedback Signed-off-by: Andrew Russell --- .github/workflows/coverage.yml | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/.github/workflows/coverage.yml b/.github/workflows/coverage.yml index 09a254a92..4b6b6f845 100644 --- a/.github/workflows/coverage.yml +++ b/.github/workflows/coverage.yml @@ -25,9 +25,11 @@ jobs: steps: - name: Checkout code - uses: actions/checkout@v6 + # actions/checkout@v6 + uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 with: fetch-depth: 0 + persist-credentials: false - name: Install uv uses: ./.github/actions/setup-uv @@ -81,7 +83,7 @@ jobs: ) gcovr "${gcovr_args[@]}" --txt --output coverage/summary.txt --print-summary | tee coverage/totals.txt - gcovr "${gcovr_args[@]}" --xml-pretty --output coverage/coverage.xml + gcovr "${gcovr_args[@]}" --xml-pretty --output coverage/cobertura.xml gcovr "${gcovr_args[@]}" --html-details --output coverage/html/index.html - name: Publish coverage summary @@ -97,18 +99,19 @@ jobs: cat coverage/totals.txt echo '```' echo - echo "Download the \`isaacteleop-coverage\` artifact for the HTML report and Cobertura XML." + echo "Download the \`isaacteleop-coverage\` artifact for the HTML report and \`coverage/cobertura.xml\`." } >> "${GITHUB_STEP_SUMMARY}" - name: Upload coverage artifact if: ${{ always() }} - uses: actions/upload-artifact@v6 + # actions/upload-artifact@v6 + uses: actions/upload-artifact@b7c566a772e6b6bfb58ed0dc250532a479d7789f with: name: isaacteleop-coverage path: | coverage/summary.txt coverage/totals.txt - coverage/coverage.xml + coverage/cobertura.xml coverage/html - if-no-files-found: warn + if-no-files-found: error retention-days: 14