Skip to content

Limit clang-tidy CI to changed files on branch workflows#390

Open
simon-d-bmw wants to merge 3 commits intoeclipse-openbsw:mainfrom
simon-d-bmw:gh-381-limit-clang-tidy-ci-scope
Open

Limit clang-tidy CI to changed files on branch workflows#390
simon-d-bmw wants to merge 3 commits intoeclipse-openbsw:mainfrom
simon-d-bmw:gh-381-limit-clang-tidy-ci-scope

Conversation

@simon-d-bmw
Copy link
Contributor

Summary

  • run the full clang-tidy scan only on pushes to main
  • run clang-tidy on changed .c, .cc, and .cpp files for pull requests, merge groups, and other branch pushes
  • skip clang-tidy cleanly when no C/C++ files changed

Details

  • add a dedicated CI helper to determine clang-tidy scope from the GitHub event payload
  • keep the existing clang-tidy findings export and reporting flow
  • update the developer documentation to describe the branch-vs-main behavior

Refs #381

…nbsw#381)

Run the full clang-tidy scan only on pushes to main.
Use changed C/C++ files for pull requests, merge groups, and other branch pushes.
…nbsw#381)

No functional change.
This updates a single C++ source file so the public PR can confirm clang-tidy only runs on changed files.
@simon-d-bmw
Copy link
Contributor Author

To test the determination of clang-tidy scope, I've added a commit which changes only console.cpp. The result is shown in this screenshot:
image

-> detection worked as expected

Treat an empty fixes YAML as zero findings so changed-file clang-tidy runs do not crash when no diagnostics are emitted.
Also align the workflow step id with GitHub Actions context validation.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant