Run clang-tidy on pull requests with GitHub Actions
Running clang-tidy once on a laptop is easy. Running it on every pull request is where projects get stuck: clang-tidy needs the real compile flags or it reports missing headers, the first run on an existing code base produces thousands of findings nobody asked for, and the output ends up in a CI log that contributors do not open.
With the GitHub Actions job below, clang-tidy findings appear as review comments on the lines a pull request changed, and the check turns red when something is left unfixed.