Files
TheRock/rocm-systems/.github/workflows/profiler-hub-version-check.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

85 lines
3.0 KiB
YAML

name: profiler-hub Version Check
run-name: profiler-hub-version-check
on:
pull_request:
paths:
- '.github/workflows/profiler-hub-version-check.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:
version-check:
name: version-check
runs-on: ubuntu-24.04
timeout-minutes: 5
steps:
- uses: actions/checkout@v6
with:
fetch-depth: 0
sparse-checkout: |
profilers/profiler-hub
.github/workflows
- name: Check version bump or CHANGELOG update
env:
BASE_REF: ${{ github.base_ref }}
run: |
set -e
BASE="origin/${BASE_REF}"
git fetch origin "${BASE_REF}"
INCLUDE_DIFF=$(git diff --name-only "${BASE}...HEAD" -- \
'profilers/profiler-hub/include/' | wc -l)
if [ "${INCLUDE_DIFF}" -eq 0 ]; then
echo "No public header changes - version check not required."
exit 0
fi
echo "Public headers changed in this PR:"
git diff --name-only "${BASE}...HEAD" -- 'profilers/profiler-hub/include/'
echo
# Escape hatch: any commit subject containing [no-version-bump]
if git log "${BASE}..HEAD" --pretty=%s | grep -qF '[no-version-bump]'; then
echo "::notice::Version-bump check skipped via [no-version-bump] commit trailer"
exit 0
fi
VERSION_REGEX='project\([[:space:]]*profiler-hub[[:space:]]+VERSION[[:space:]]+[0-9]+\.[0-9]+\.[0-9]+'
OLD=$(git show "${BASE}:profilers/profiler-hub/CMakeLists.txt" \
| grep -oE "${VERSION_REGEX}" || true)
NEW=$(grep -oE "${VERSION_REGEX}" \
profilers/profiler-hub/CMakeLists.txt || true)
if [ -n "${NEW}" ] && [ "${OLD}" != "${NEW}" ]; then
echo "::notice::Version bumped: ${OLD##*VERSION } -> ${NEW##*VERSION }"
exit 0
fi
CHANGELOG_DIFF=$(git diff --name-only "${BASE}...HEAD" -- \
'profilers/profiler-hub/CHANGELOG.md' | wc -l)
if [ "${CHANGELOG_DIFF}" -gt 0 ]; then
echo "::notice::CHANGELOG.md updated; version bump may be deferred to release."
exit 0
fi
{
echo "::error::Public headers under profilers/profiler-hub/include/ changed but no version bump in CMakeLists.txt and no CHANGELOG.md update."
echo
echo "Pick one of:"
echo " 1. Bump 'project(profiler-hub VERSION ...)' in profilers/profiler-hub/CMakeLists.txt"
echo " 2. Add an entry under '## [Unreleased]' in profilers/profiler-hub/CHANGELOG.md"
echo " 3. Add '[no-version-bump]' to a commit subject if this change is genuinely non-user-facing"
}
exit 1