feat: Better lint and test for devs and Makefile cleanup. #511
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This change does several things all towards the end of making
it easier for developers to run tests and lint on go code.
Now a developer can run either 'make go-test' or 'make lint'
without having lots of C dependencies or running in a specific
container or stacker.
Things changed:
Add a build tag 'skipembed' that builds without needing
cmd/stacker/lxc-wrapper/lxc-wrapper . This allows you to
build (or test) without that file. In order to ensure that
you do not get very far trying to run a 'stacker' binary,
I've added a 'panic' if stacker binary is built with skipembed.
Add download-tools target to makefile to ease in downloading of
regctl and zot.
Move the downloading of golangci-lint from the github workflow
to Makefile. This makes it easier for developer to get it.
It is also added to the 'download-tools' target.
be specific about the version of golangci-lint that is used.
1.54.2. golangci-lint's docs specifically say to do this:
changing it is simply a matter of changing the value in the makefile.
Move running of 'go test' out of the lint target to its own
'go-test' target. go-test target will now write a coverage.html
so you can view coverage easily.
add 'dlbin' makefile "function" for downloading binaries, and use
that for regctl and zot from their rules.