[AIROCMLIR-197] Move C++ format/tidy checks to GitHub Actions#2356
[AIROCMLIR-197] Move C++ format/tidy checks to GitHub Actions#2356bogdan-petkovic wants to merge 18 commits intoROCm:developfrom
Conversation
fcb2e9d to
ff2cfcf
Compare
There was a problem hiding this comment.
I would keep preMergeCheck in the Jenkinsfile for at least 1–2 weeks after merging this PR, to ensure that the new GitHub Action works correctly with incoming PRs. During this testing phase, we would run both Jenkins and GitHub Actions in parallel. I would validate the setup by opening PRs that are expected to fail preMergeCheck and then compare the outputs from Jenkins and GitHub Actions. Once we confirm it works as expected, I would remove it from the Jenkinsfile in a follow-up PR. We don’t want checks that don’t fully enforce formatting (e.g., clang-format) on the develop branch
There was a problem hiding this comment.
But check for this with @umangyadav @mirza-halilcevic @dhernandez0
There was a problem hiding this comment.
Agreed, running them in parallel for a week or two is a good call
73aed8e to
cb4015c
Compare
…ng on formatting Signed-off-by: bogdan-petkovic <bogdan.petkovic@htecgroup.com>
Signed-off-by: bogdan-petkovic <bogdan.petkovic@htecgroup.com>
Signed-off-by: bogdan-petkovic <bogdan.petkovic@htecgroup.com>
Signed-off-by: bogdan-petkovic <bogdan.petkovic@htecgroup.com>
Signed-off-by: bogdan-petkovic <bogdan.petkovic@htecgroup.com>
cb4015c to
d953156
Compare
|
@bogdan-petkovic can you review using AI agents first ? it is reporting some major problems |
@umangyadav I've assigned copilot for that |
There was a problem hiding this comment.
Pull request overview
This PR moves C/C++ diff-based clang-format and clang-tidy checks out of Jenkins and into GitHub Actions by introducing a dedicated cpp-static-checks job that runs the existing mlir/utils/jenkins/static-checks/premerge-checks.py inside the rocm/mlir:rocm7.2-latest container.
Changes:
- Add a new
cpp-static-checksGitHub Actions job to run diff-basedclang-formatandclang-tidychecks. - Generate and expose
compile_commands.jsonvia CMake configure (-DCMAKE_EXPORT_COMPILE_COMMANDS=ON) for the tidy-diff step. - Add caching for the
build/directory to reduce repeated CMake configure cost.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Signed-off-by: bogdan-petkovic <bogdan.petkovic@htecgroup.com>
Signed-off-by: bogdan-petkovic <bogdan.petkovic@htecgroup.com>
…NER=1 Signed-off-by: bogdan-petkovic <bogdan.petkovic@htecgroup.com>
Signed-off-by: bogdan-petkovic <bogdan.petkovic@htecgroup.com>
…time Signed-off-by: bogdan-petkovic <bogdan.petkovic@htecgroup.com>
Signed-off-by: bogdan-petkovic <bogdan.petkovic@htecgroup.com>
| @@ -11,6 +11,8 @@ on: | |||
| - "!external/llvm-project/**" | |||
There was a problem hiding this comment.
we excluded external/llvm-project/** for py checks, with current change the exclusion applies to both py ones and cpp-static-checks. Check with @umangyadav / @dhernandez0 whether it should stay as it is
There was a problem hiding this comment.
You're right, and I looked into this and if we want to properly include external LLVM patches in the C++ check we actually have 3 options:
- Split into 2 workflow files, a small cpp-static-checks.yml with its own path filter that includes external/llvm-project/**, and keep ci.yml for Python.
- Remove the !external/llvm-project/** exclusion. C++ and Python jobs both trigger on LLVM-only PRs. Python only checks files under mlir/ so it won't touch LLVM Python files, but it's some overhead per run for nothing.
- Leave as it is. C++ checks will catch LLVM patches when a PR has both rocMLIR and LLVM changes, but LLVM-only PRs won't trigger the job at all.
My vote is option 1, a separate cpp-static-checks.yml would be just a small file with its own path filter. What do you guys think? @umangyadav @dhernandez0
| - ".clang-tidy" | ||
| jobs: | ||
| cpp-static-checks: | ||
| name: C/C++ clang-format + clang-tidy (diff-based) |
There was a problem hiding this comment.
and do we run diff-based one as well on Jenkins? or we do for everything?
There was a problem hiding this comment.
Yeah, same on Jenkins. It calls the exact same premerge-checks.py script with --base-commit=origin/${targetBranch}, so it's always diff-based. The script only checks changes relative to the base branch, never the full codebase
Signed-off-by: bogdan-petkovic <bogdan.petkovic@htecgroup.com>

Motivation
Move C/C++ formatting and diff-based clang-tidy checks out of Jenkins so GPU CI isn't blocked by style issues, and enforce these checks earlier/cheaper in GitHub Actions.
Technical Details
Test Plan
Test Result
Not run locally; relies on GitHub Actions and Jenkins pipeline execution after submission.
Submission Checklist