Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Create a GitHub workflow for running clang-tidy #39478

Merged
merged 9 commits into from
Apr 13, 2020

Conversation

jbytheway
Copy link
Contributor

Summary

SUMMARY: Infrastructure "Create a GitHub workflow for running clang-tidy"

Purpose of change

The Travis clang-tidy job is problematic. It doesn't have sufficient time to run clang-tidy across everything, and it often doesn't run at all because some earlier job failed for a reason unrelated to the PR in question.

This leads to clang-tidy errors creeping into the codebase more often than we would prefer.

Describe the solution

Create a GitHub workflow running clang-tidy to replace the Travis job. This has a much longer timeout, and so we shoul be able to run clang-tidy to completion, and start it sooner.

Long term plan is to remove the Travis job, if this goes well.

Describe alternatives you've considered

Moving the Travis clang-tidy job earlier in the Travis sequence.

I considered going directly to clang-tidy-10 with this PR, but I don't want to change too many variables at once.

Testing

Has to be tested live on this PR. So this is likely to remain draft for a while.

@jbytheway jbytheway force-pushed the clang_tidy_github_workflow branch 3 times, most recently from 0f77ffd to edfee00 Compare April 11, 2020 17:34
@jbytheway
Copy link
Contributor Author

jbytheway commented Apr 11, 2020

Well, this is weird. I have the workflow running clang-tidy, but it's reporting vast numbers of warnings that are just wrong, like unused parameter warnings for seemingly every parameter of every function. I have no idea what's up...

Edit: OK, I figured out that mystery. Was an include path issue.

@jbytheway jbytheway force-pushed the clang_tidy_github_workflow branch 7 times, most recently from ecdcb2f to df03fdd Compare April 12, 2020 01:30
The GitHub workflow VM doesn't have wheel configured correctly for
newer package installs.  Try to upgrade it first.
I was having trouble debugging include issues in the GitHub workflow for
clang-tidy.  Therefore, dump the compiler and clang-tidy header search
paths to help debug such issues now and in the future.
A difference in the clang include paths between Travis and GitHub
workflows means that the custom clang-tidy we're using doesn't quite
work correctly on GitHub.  Work around this by adding a new include
directory explicitly.
@jbytheway jbytheway force-pushed the clang_tidy_github_workflow branch from df03fdd to 644e7fa Compare April 12, 2020 11:34
@jbytheway jbytheway marked this pull request as ready for review April 12, 2020 12:06
@jbytheway jbytheway changed the title [WIP] Create a GitHub workflow for running clang-tidy Create a GitHub workflow for running clang-tidy Apr 12, 2020
@jbytheway
Copy link
Contributor Author

OK, I think this is now working.

The new job is failing right now, because of a genuine clang-tidy error for which I've opened the separate PR #39494.

It's still stopping after the same time limit as the Travis CI for now (because it's running the same code). I plan to remove the Travis CI and remove that constraint in a future PR.

@kevingranade kevingranade merged commit d925026 into CleverRaven:master Apr 13, 2020
@jbytheway jbytheway deleted the clang_tidy_github_workflow branch April 13, 2020 11:09
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.

2 participants