Files
derek.holloway 7502bf64a4
CodeQL / Analyze (actions) (push) Canceled after 0s
CodeQL / Analyze (python) (push) Canceled after 0s
pre-commit / pre-commit (push) Canceled after 0s
Multi-Arch CI / setup (push) Canceled after 0s
Publish build_manylinux_x86_64 images / publish_build_manylinux_x86_64 (push) Canceled after 0s
Setup (Multi-Arch) / setup (push) Canceled after 0s
Multi-Arch CI / Linux::${{ fromJSON(needs.setup.outputs.linux_build_config || '{}').build_variant_label || 'skip' }} (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Publish no_rocm_image_ubi10 image / publish_no_rocm_image_ubi10 (push) Canceled after 0s
Multi-Arch CI / Windows::${{ fromJSON(needs.setup.outputs.windows_build_config || '{}').build_variant_label || 'skip' }} (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Multi-Arch CI / Manifest Diff (push) Canceled after 0s
TheRock Manifest Diff Report / Generate Manifest Diff Report (push) Canceled after 0s
Multi-Arch CI / CI Summary (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04 (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04_ocl_rt images / publish_no_rocm_image_ubuntu24_04_ocl_rt (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_rocgdb (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04_rocgdb images / publish_no_rocm_image_ubuntu24_04_rocgdb (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_ocl_rt (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Unit Tests / Unit Tests :: ubuntu-24.04 (push) Canceled after 0s
Unit Tests / Unit Tests :: windows-2022 (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_media (push) Canceled after 0s
Unit Tests / Unit Tests Summary (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_openmpi (push) Canceled after 0s
Flatten subprojects into a single base monorepo
2026-09-02 16:34:47 -07:00

120 lines
3.8 KiB
YAML

name: profiler-hub Coverage
run-name: profiler-hub-coverage
on:
workflow_dispatch:
push:
branches:
- develop
paths:
- '.github/workflows/profiler-hub-coverage.yml'
- 'profilers/profiler-hub/**'
- '!profilers/profiler-hub/build/**'
- '!profilers/profiler-hub/docs/**'
- '!profilers/profiler-hub/README.md'
pull_request:
paths:
- '.github/workflows/profiler-hub-coverage.yml'
- 'profilers/profiler-hub/**'
- '!profilers/profiler-hub/build/**'
- '!profilers/profiler-hub/docs/**'
- '!profilers/profiler-hub/README.md'
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
permissions:
contents: read
jobs:
coverage:
name: coverage
runs-on: ubuntu-24.04
timeout-minutes: 30
env:
CC: gcc
CXX: g++
steps:
- uses: actions/checkout@v6
with:
sparse-checkout: |
profilers/profiler-hub
.github/workflows
- name: Install dependencies
run: |
sudo apt-get update
sudo apt-get install -y \
cmake \
gcc g++ \
lcov gcovr \
libsqlite3-dev libspdlog-dev libfmt-dev nlohmann-json3-dev \
libgtest-dev libgmock-dev libbenchmark-dev
- name: Configure
working-directory: profilers/profiler-hub
run: |
cmake --version
gcovr --version | head -1
cmake -S . -B build \
-DCMAKE_BUILD_TYPE=Debug \
-DPROFILER_HUB_ENABLE_COVERAGE=ON \
-DPROFILER_HUB_BUILD_TESTS=ON \
-DPROFILER_HUB_BUILD_BENCHMARKS=OFF
- name: Build
working-directory: profilers/profiler-hub
run: cmake --build build --parallel $(nproc)
- name: Generate Cobertura coverage report
working-directory: profilers/profiler-hub
run: |
set -o pipefail
cmake --build build --target coverage-xml 2>&1 | tee coverage.log
test -f build/coverage/coverage.xml
- name: Summarize coverage
working-directory: profilers/profiler-hub
run: |
LINES=$(grep -oE 'lines: [0-9.]+%' coverage.log | tail -1 || echo "lines: n/a")
FUNCS=$(grep -oE 'functions: [0-9.]+%' coverage.log | tail -1 || echo "functions: n/a")
BRANCHES=$(grep -oE 'branches: [0-9.]+%' coverage.log | tail -1 || echo "branches: n/a")
{
echo "## Coverage summary"
echo ""
echo "| Metric | Value |"
echo "|--------|-------|"
echo "| ${LINES%:*} | ${LINES#*: } |"
echo "| ${FUNCS%:*} | ${FUNCS#*: } |"
echo "| ${BRANCHES%:*} | ${BRANCHES#*: } |"
} >> "${GITHUB_STEP_SUMMARY}"
echo "${LINES} | ${FUNCS} | ${BRANCHES}"
- name: Enforce line coverage threshold
working-directory: profilers/profiler-hub
env:
COVERAGE_LINES_THRESHOLD: '80'
run: |
set -euo pipefail
LINES_PCT=$(grep -oE 'lines: [0-9.]+%' coverage.log \
| tail -1 \
| grep -oE '[0-9.]+')
if [ -z "${LINES_PCT}" ]; then
echo "ERROR: could not parse line coverage from coverage.log" >&2
exit 1
fi
echo "Line coverage: ${LINES_PCT}% (threshold: ${COVERAGE_LINES_THRESHOLD}%)"
awk -v cov="${LINES_PCT}" -v thr="${COVERAGE_LINES_THRESHOLD}" \
'BEGIN { exit (cov + 0 >= thr + 0) ? 0 : 1 }' \
|| { echo "FAIL: line coverage ${LINES_PCT}% below threshold ${COVERAGE_LINES_THRESHOLD}%" >&2; exit 1; }
- name: Upload coverage artifact
if: always()
uses: actions/upload-artifact@v7
with:
name: coverage-xml
path: profilers/profiler-hub/build/coverage/coverage.xml
if-no-files-found: warn