ci: add a checkmake workflow#15683
Conversation
a217bab to
f77a1d0
Compare
| wget https://github.com/mrtazz/checkmake/releases/download/0.2.2/checkmake-0.2.2.linux.amd64 | ||
| sudo install ./checkmake-0.2.2.linux.amd64 /usr/local/bin/checkmake | ||
| - name: Run CheckMake | ||
| run: make checkmake |
There was a problem hiding this comment.
Looks like the action isn't working yet. The log shows:
Run make checkmake
make checkmake
shell: /usr/bin/bash -e {0}
bash: line 1: /home/runner/work/rook/rook/.cache/tools/linux_amd6[4](https://github.com/rook/rook/actions/runs/14591180591/job/40945472851#step:4:4)/yq-v[4](https://github.com/rook/rook/actions/runs/14591180591/job/40945472851#step:4:5).45.1: No such file or directory
checkmake Makefile
There was a problem hiding this comment.
@travisn wrote:
Looks like the action isn't working yet. The log shows:
Run make checkmake make checkmake shell: /usr/bin/bash -e {0} bash: line 1: /home/runner/work/rook/rook/.cache/tools/linux_amd6[4](https://github.com/rook/rook/actions/runs/14591180591/job/40945472851#step:4:4)/yq-v[4](https://github.com/rook/rook/actions/runs/14591180591/job/40945472851#step:4:5).45.1: No such file or directory checkmake Makefile
This is strange! The workflow is reported as succeeding but the log is showing this error.
And it is yet unclear to me why it should require yq.
make checkmake does not require yq locally and the workflow yaml does not reference yq.
I can only guess that github is somehow using yq internally when processing the workflow yaml file.
If that is the case, I am still unclear how it can be fixed in the PR.
There was a problem hiding this comment.
I tried to improve the situation by installing yq as part of the workflow, but it did not help.
There was a problem hiding this comment.
Since it did not help, I removed installation of yq again (or rather, commented it out). Instead, I changed the workflow to run checkmake Makefile directly instead of invoking make checkmake because I suspected the error message might be related to the use of make. The result looks promising:
The job still succeeds but now without the weird yq-related error message.
There was a problem hiding this comment.
As a next step, I intend to add a test commit to trigger failure of checkmake.
There was a problem hiding this comment.
now that the the suspicion was confirmed, I removed the commented-out yq-installation lies to make the workflow file cleaner.
8d9f60f to
9f598b2
Compare
60aabbd to
d1b795d
Compare
This change is not intended to be merged. It is intended to prove for PR rook#15683 that checkmake fails under circumstances. The commit be removed from the PR brfore merging. This adds a target "long" to the Makefile which should trigger the 'maxbodylength failure of checkmake: 'Target body for "long" exceeds allowed length of 5 (8).' Signed-off-by: Michael Adam <[email protected]>
|
@travisn as we discussed, I added a test commit that triggers failure of checkmake to prove that this ci workflow can catch regressions in the Makefile. I see that the job has failed as expected with the maxbodylength rule:
If this PR is otherwise fine and agreed to be added, I'll remove the test commit before merging. |
d1b795d to
49ce1bf
Compare
Great to see it's working as expected now, so feel free to revert the test commit. |
49ce1bf to
b5625d1
Compare
|
@travisn wrote:
done. commit removed |
| run: | | ||
| sudo apt-get update | ||
| sudo apt-get install -y wget | ||
| wget https://github.com/mrtazz/checkmake/releases/download/0.2.2/checkmake-0.2.2.linux.amd64 |
There was a problem hiding this comment.
does it not have a explicitly action plugin likehttps://github.com/rook/rook/blob/master/.github/workflows/auto-assign.yaml#L18C15-L18C75?
There was a problem hiding this comment.
@parth-gr wrote:
does it not have a explicitly action plugin like https://github.com/rook/rook/blob/master/.github/workflows/auto-assign.yaml#L18C15-L18C75?
It does have an action:
https://github.com/marketplace/actions/checkmake-action
But I prefer to write workflows with commands that can easily be invoked locally by developers. Actions, in contrast, are putting the invocation in a blackbox that makes it difficult to understand what exactly is run.
There was a problem hiding this comment.
In rook we have mostly use actions, @travisn for thoughts
There was a problem hiding this comment.
One advantage of the actions is that the dependabot will automatically update them, otherwise we have to update them manually, which doesn't have often enough. So I do like the idea of using the action instead.
There was a problem hiding this comment.
@travisn wrote:
One advantage of the actions is that the dependabot will automatically update them,
otherwise we have to update them manually, which doesn't have often enough. So I do like the idea of using the action instead.
Fair. rewritten to use the action. (but reluctantly ... ;)
b5625d1 to
dcbf37d
Compare
|
added a test commit again to trigger failure of the action. |
travisn
left a comment
There was a problem hiding this comment.
Looks good with the failure commit, feel free to revert that
| steps: | ||
| - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 | ||
| - name: Run CheckMake | ||
| uses: Uno-Takashi/checkmake-action@main |
There was a problem hiding this comment.
Instead of main is there some tag we can use for the latest release?
There was a problem hiding this comment.
@travisn wrote:
Instead of
mainis there some tag we can use for the latest release?
according to https://github.com/marketplace/actions/checkmake-action, v2is the latest version available.
I changed the workflow to use that.
87c1369 to
dcbf37d
Compare
done. |
lint the Makefile in the CI This is to prevent PRs from introducing errors in the Makefile Signed-off-by: Michael Adam <[email protected]>
dcbf37d to
5aa6d3b
Compare
| - name: Run CheckMake | ||
| uses: Uno-Takashi/checkmake-action@v2 | ||
| with: | ||
| Makefile: Makefile |
There was a problem hiding this comment.
Does this only run on the makefile in the root folder? Can we also run it against the makefiles in other folders?
There was a problem hiding this comment.
@travisn wrote:
Does this only run on the makefile in the root folder?
yes currently only against the main Makefile.
Can we also run it against the makefiles in other folders?
We can, but locally, these files show errors:
build/release/Makefile images/Makefile images/ceph/MakefileThere was a problem hiding this comment.
Ok as discussed offline, let's go ahead with just the main Makefile for now.
| - name: Run CheckMake | ||
| uses: Uno-Takashi/checkmake-action@v2 | ||
| with: | ||
| Makefile: Makefile |
There was a problem hiding this comment.
Ok as discussed offline, let's go ahead with just the main Makefile for now.
Description of changes:
This adds
linting of the Makefile in the CI
in order to prevent PRs from introducing errors in the Makefile
Checklist: