Files
TheRock/rocm-systems/.github/workflows/rocprofiler-systems-code-coverage.yml
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

212 lines
6.6 KiB
YAML

name: rocprofiler-systems Code Coverage
permissions:
contents: read
on:
workflow_call:
env:
ROCPROFSYS_TMPDIR: "%env{PWD}%/testing-tmp"
jobs:
rocprofiler-systems-code-coverage:
runs-on: ubuntu-latest
permissions:
contents: read
pull-requests: write
strategy:
fail-fast: false
matrix:
rocm-version: ['7.2']
container:
image: dgaliffiamd/rocprofiler-systems:ci-rocm-${{ matrix.rocm-version }}-ubuntu-22.04
options: --cap-add CAP_SYS_ADMIN
env:
OMPI_ALLOW_RUN_AS_ROOT: 1
OMPI_ALLOW_RUN_AS_ROOT_CONFIRM: 1
ROCPROFSYS_CAUSAL_BACKEND: perf
ROCPROFSYS_CI: 'ON'
ROCPROFSYS_MAX_THREADS: '64'
ROCPROFSYS_KEEP_TEST_OUTPUT: '0'
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
sparse-checkout: |
projects/rocprofiler-systems/
.gitmodules
- name: Configure ROCm Environment
shell: bash
run: |
echo "/opt/rocm/bin" >> $GITHUB_PATH
echo "ROCM_PATH=/opt/rocm" >> $GITHUB_ENV
echo "LD_LIBRARY_PATH=/opt/rocm/lib:${LD_LIBRARY_PATH}" >> $GITHUB_ENV
- name: Install Packages
timeout-minutes: 25
uses: nick-fields/retry@ad984534de44a9489a53aefd81eb77f87c70dc60 #v4.0.0
with:
retry_wait_seconds: 30
timeout_minutes: 25
max_attempts: 5
command: |
apt-get update &&
apt-get remove -y --purge 'libopenmpi-dev' 'libopenmpi3' 'openmpi-bin' 'openmpi-common' &&
apt-get autoremove -y --purge &&
apt-get upgrade -y &&
apt-get install -y libomp-dev libtbb-dev \
libdw-dev libdwarf-dev libelf-dev libiberty-dev \
libmpich-dev mpich &&
apt-get autoclean
- name: Install gcovr
timeout-minutes: 10
shell: bash
run: pip3 install 'gcovr>=8.4'
- name: Sync gcov with GCC
shell: bash
run: |
GCC_VER=$(gcc -dumpversion | cut -d. -f1)
echo "GCC version: ${GCC_VER}"
update-alternatives \
--install /usr/bin/gcov gcov /usr/bin/gcov-${GCC_VER} 500
- name: Configure
timeout-minutes: 15
shell: bash
working-directory: projects/rocprofiler-systems/
env:
GIT_DISCOVERY_ACROSS_FILESYSTEM: 1
run: |
git config --global --add safe.directory ${GITHUB_WORKSPACE}
git config --global --add safe.directory ${PWD}
echo "CMake version: $(cmake --version | head -n 1)"
echo "Compiler version: $(gcc --version | head -n 1)"
cmake --preset coverage \
-DROCPROFSYS_PYTHON_PREFIX=/opt/conda/envs \
-DROCPROFSYS_PYTHON_ENVS=py3.12 \
"-DROCPROFSYS_DISABLE_EXAMPLES=transpose;rccl;videodecode;jpegdecode;openmp;roctx;scratch-memory;unified-memory;transferBench;hpc;sdma_test" \
-DROCPROFSYS_BUILD_NUMBER=${{ github.run_attempt }}
- name: Build
timeout-minutes: 60
shell: bash
working-directory: projects/rocprofiler-systems/
run: |
cmake --build build/coverage --parallel $(nproc)
- name: Unit Tests
timeout-minutes: 10
shell: bash
working-directory: projects/rocprofiler-systems/
run: |
./build/coverage/bin/rocprof-sys-unit-tests
- name: Generate Unit Test Coverage
if: always()
timeout-minutes: 15
shell: bash
working-directory: projects/rocprofiler-systems/
run: |
python3 scripts/generate-coverage.py \
--build-dir build/coverage \
--source-dir . \
--output-dir .codecov \
--label unit-tests
- name: E2E Tests
timeout-minutes: 60
shell: bash
working-directory: projects/rocprofiler-systems/
run: |
find build/coverage -name '*.gcda' -delete
ctest --test-dir build/coverage \
--output-on-failure \
-LE "network|gpu" \
--repeat until-pass:3 after-timeout:2
- name: Generate E2E Coverage
if: always()
timeout-minutes: 15
shell: bash
working-directory: projects/rocprofiler-systems/
run: |
python3 scripts/generate-coverage.py \
--build-dir build/coverage \
--source-dir . \
--output-dir .codecov \
--label e2e-tests
- name: Generate Coverage Comment
if: always()
id: generatereport
shell: bash
working-directory: projects/rocprofiler-systems/
run: |
get-md-contents() { if [ -f ".codecov/${1}.md" ]; then cat ".codecov/${1}.md"; else echo "_No report generated._"; fi; }
{
echo "# Code Coverage Report"
echo ""
echo "## Unit Tests"
get-md-contents unit-tests
echo ""
echo "## E2E Tests"
get-md-contents e2e-tests
echo ""
echo "<!-- rocprofiler-systems-coverage -->"
} > .codecov/report.md
echo 'CODECOVERAGE_REPORT<<EOF' >> $GITHUB_OUTPUT
cat .codecov/report.md >> $GITHUB_OUTPUT
echo 'EOF' >> $GITHUB_OUTPUT
- name: Write Code Coverage Comment
if: github.event_name == 'pull_request'
timeout-minutes: 5
uses: actions/github-script@3a2844b7e9c422d3c10d287c895573f7108da1b3 # v9
env:
COMMENT_BODY: |
<details>
<summary><h2>Code Coverage Report</h2></summary>
<!-- Keep the empty line above to render markdown properly -->
${{ steps.generatereport.outputs.CODECOVERAGE_REPORT }}
</details>
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
script: |
const commentIdentifier = '<!-- rocprofiler-systems-coverage -->';
const commentBody = process.env.COMMENT_BODY;
const { data: comments } = await github.rest.issues.listComments({
owner: context.repo.owner,
repo: context.repo.repo,
issue_number: context.payload.pull_request.number,
});
const existingComment = comments.find(comment => comment.body.includes(commentIdentifier));
if (existingComment) {
await github.rest.issues.updateComment({
owner: context.repo.owner,
repo: context.repo.repo,
comment_id: existingComment.id,
body: commentBody,
});
core.info(`Updated comment with ID: ${existingComment.id}`);
} else {
await github.rest.issues.createComment({
owner: context.repo.owner,
repo: context.repo.repo,
issue_number: context.payload.pull_request.number,
body: commentBody,
});
core.info('Created a new comment.');
}