-
Notifications
You must be signed in to change notification settings - Fork 129
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
CI workflow to check clang-format usage on pull requests #3561
Conversation
|
I am using nektos/act to test this action locally. |
@Sonicadvance1 can you please create a read-only github token |
What github token do you need? We don't use Github's CI runners and instead run everything on self-hosted runners. So this workflow will need some changes to facilitate that. |
This one could run using Github CI runners, and it would avoid putting pressure on your local machines. What do you think? |
It's just setting up a python environment and running a script isn't it? The pressure on the self-hosted CI system should be negligible. |
That's fine by me. Let me refactor this considering it's going to run self-hosted. |
I have updated the PR not to use a secret and to run self-hosted. But by not passing a secret, it means it won't be able to update the PR with the reason for failure like in llvm/llvm-project#88244 (comment) |
With some modifications to the workflow file you should be able to test this with our self-hosted runners while it is still in PR form |
Yes. Thanks. I will look at it first thing on Monday. |
I am getting this error:
Can you update the permissions please? |
Updated permissions |
|
The code-format-helper has a bug and makes |
Does the full llvm-repo need to be pulled in or can we just have those in an |
As far as I understand the sparse checkout just pulls those two files. We could have it in externals and sync when needed but it was to avoid pulling yet more externals. |
Didn't realize it was sparse, so that's good. Having it in Externals for one we control still sounds reasonable to me. |
yeah - was just thinking about it. If we pull it from llvm, it means that at a push of a button, llvm can break our CI which is not good. I will pull it to externals then and ensure I check the need for sync on a regular basis. |
@Sonicadvance1 git-clang-format doesn't seem to be installed on the runner. Maybe installing clang-format-16 only installed git-clang-format-16? |
It only installed |
But it also created git-clang-format-16 right? |
Nice - it works. A bad formatting of Frontend.cpp is caught by the CI. Logs show:
|
Oh, you're right. I didn't realize that was a different tool. It did install |
Adapted from LLVM version of pr-code-format.yml. Copies a few scripts from LLVM to External/. Runs self-hosted on X64. Assumes clang-format 16.0.6 for formatting.
OK - testing complete. It seems to be working. I have made sure it only runs for FEX repo and pull requests to the main branch. |
@Sonicadvance1 ready for review. |
Adapted but heavily copied from LLVM version of pr-code-format.yml.