[rocprofiler-sdk] Fix formatting, linting, and CI workflows (#345)

* [rocprofiler-sdk] Fix formatting and lint workflows

- several formatting workflows were silently failing when listing files

* format metrics_test.h

* Improve formatting job robustness

* Source formatting workflow does not use container

* Use PyPi clang-format

* Format rocpd/source/csv.cpp source

* Fix rocprofiler-sdk CI workflow

- fix invalid context access

* Update run-ci.py

- fix ctest_update

* Update run-ci.py

- handle old checkout in ROCm/rocprofiler-sdk
This commit is contained in:
Jonathan R. Madsen
2025-08-14 00:02:23 -05:00
committed by GitHub
parent e28900793b
commit 9df2c1ec68
6 changed files with 111 additions and 269 deletions
@@ -101,7 +101,7 @@ jobs:
ls -la
- name: Enable PC Sampling
if: ${{ contains(matrix.system.gpu, 'mi200') || contains(matrix.system.gpu, 'mi300a') }}
if: ${{ contains(matrix.runner, 'mi200') || contains(matrix.runner, 'mi300a') }}
shell: bash
working-directory: projects/rocprofiler-sdk
run:
@@ -113,41 +113,40 @@ jobs:
working-directory: projects/rocprofiler-sdk
run:
python3 ./source/scripts/run-ci.py -B build
--name ${{ github.repository }}-${{ github.ref_name }}-${{ matrix.system.os }}-${{ matrix.system.gpu }}-core
--name ${{ github.repository }}-${{ github.ref_name }}-${{ matrix.os }}-${{ matrix.runner }}-core
--build-jobs 16
--site ${RUNNER_HOSTNAME}
--gpu-targets ${{ env.GPU_TARGETS }}
--run-attempt ${{ github.run_attempt }}
${{ matrix.system.ci-flags }}
--
-DROCPROFILER_DEP_ROCMCORE=ON
-DROCPROFILER_BUILD_DOCS=OFF
-DCMAKE_BUILD_TYPE=${{ matrix.system.build-type }}
-DCMAKE_BUILD_TYPE=${{ matrix.build-type }}
-DCMAKE_INSTALL_PREFIX=/opt/rocprofiler-sdk
-DCPACK_GENERATOR='DEB;RPM;TGZ'
-DCPACK_PACKAGING_INSTALL_PREFIX="$(realpath /opt/rocm)"
-DPython3_EXECUTABLE=$(which python3)
${{ env.GLOBAL_CMAKE_OPTIONS }}
--
-LE "${${{ matrix.system.gpu }}_EXCLUDE_LABEL_REGEX}"
-E "${${{ matrix.system.gpu }}_EXCLUDE_TESTS_REGEX}"
-LE "${${{ matrix.runner }}_EXCLUDE_LABEL_REGEX}"
-E "${${{ matrix.runner }}_EXCLUDE_TESTS_REGEX}"
- name: Install
if: ${{ contains(matrix.system.gpu, env.CORE_EXT_RUNNER) }}
if: ${{ contains(matrix.runner, env.CORE_EXT_RUNNER) }}
timeout-minutes: 10
working-directory: projects/rocprofiler-sdk
run:
cmake --build build --target install --parallel 16
- name: Build Packaging
if: ${{ contains(matrix.system.gpu, env.CORE_EXT_RUNNER) }}
if: ${{ contains(matrix.runner, env.CORE_EXT_RUNNER) }}
timeout-minutes: 10
working-directory: projects/rocprofiler-sdk
run:
cmake --build build --target package --parallel 16
- name: Test Install Build
if: ${{ contains(matrix.system.gpu, env.CORE_EXT_RUNNER) }}
if: ${{ contains(matrix.runner, env.CORE_EXT_RUNNER) }}
timeout-minutes: 20
shell: bash
working-directory: projects/rocprofiler-sdk
@@ -157,11 +156,11 @@ jobs:
export LD_LIBRARY_PATH=/opt/rocprofiler-sdk/lib:${LD_LIBRARY_PATH}
cmake --build build-samples --target all --parallel 16
cmake --build build-tests --target all --parallel 16
ctest --test-dir build-samples -LE "${${{ matrix.system.gpu }}_EXCLUDE_LABEL_REGEX}" -E "${${{ matrix.system.gpu }}_EXCLUDE_TESTS_REGEX}" --output-on-failure
ctest --test-dir build-tests -LE "${${{ matrix.system.gpu }}_EXCLUDE_LABEL_REGEX}" -E "${${{ matrix.system.gpu }}_EXCLUDE_TESTS_REGEX}" --output-on-failure
ctest --test-dir build-samples -LE "${${{ matrix.runner }}_EXCLUDE_LABEL_REGEX}" -E "${${{ matrix.runner }}_EXCLUDE_TESTS_REGEX}" --output-on-failure
ctest --test-dir build-tests -LE "${${{ matrix.runner }}_EXCLUDE_LABEL_REGEX}" -E "${${{ matrix.runner }}_EXCLUDE_TESTS_REGEX}" --output-on-failure
- name: Install Packages
if: ${{ contains(matrix.system.gpu, env.CORE_EXT_RUNNER) }}
if: ${{ contains(matrix.runner, env.CORE_EXT_RUNNER) }}
timeout-minutes: 5
shell: bash
working-directory: projects/rocprofiler-sdk
@@ -174,7 +173,7 @@ jobs:
for i in $(ls -S ./build/rocprofiler-sdk*.deb | egrep -v 'roctx|rocpd'); do dpkg --force-all -i ${i}; done;
- name: Test Installed Packages
if: ${{ contains(matrix.system.gpu, env.CORE_EXT_RUNNER) }}
if: ${{ contains(matrix.runner, env.CORE_EXT_RUNNER) }}
timeout-minutes: 20
shell: bash
working-directory: projects/rocprofiler-sdk
@@ -183,11 +182,11 @@ jobs:
CMAKE_PREFIX_PATH=/opt/rocm cmake -B build-tests-deb -DGPU_TARGETS="gfx942" /opt/rocm/share/rocprofiler-sdk/tests
cmake --build build-samples-deb --target all --parallel 16
cmake --build build-tests-deb --target all --parallel 16
ctest --test-dir build-samples-deb -LE "${${{ matrix.system.gpu }}_EXCLUDE_LABEL_REGEX}" -E "${${{ matrix.system.gpu }}_EXCLUDE_TESTS_REGEX}" --output-on-failure
ctest --test-dir build-tests-deb -LE "${${{ matrix.system.gpu }}_EXCLUDE_LABEL_REGEX}" -E "${${{ matrix.system.gpu }}_EXCLUDE_TESTS_REGEX}" --output-on-failure
ctest --test-dir build-samples-deb -LE "${${{ matrix.runner }}_EXCLUDE_LABEL_REGEX}" -E "${${{ matrix.runner }}_EXCLUDE_TESTS_REGEX}" --output-on-failure
ctest --test-dir build-tests-deb -LE "${${{ matrix.runner }}_EXCLUDE_LABEL_REGEX}" -E "${${{ matrix.runner }}_EXCLUDE_TESTS_REGEX}" --output-on-failure
- name: Archive production artifacts
if: ${{ github.event_name == 'workflow_dispatch' && contains(matrix.system.gpu, env.CORE_EXT_RUNNER) }}
if: ${{ github.event_name == 'workflow_dispatch' && contains(matrix.runner, env.CORE_EXT_RUNNER) }}
uses: actions/upload-artifact@v4
with:
name: installers-deb