-
Notifications
You must be signed in to change notification settings - Fork 2.1k
GitHub Actions for lint #3211
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
GitHub Actions for lint #3211
Conversation
f1f3394 to
2580dea
Compare
|
We could also cleanup |
Codecov Report
@@ Coverage Diff @@
## master #3211 +/- ##
=======================================
Coverage 58.58% 58.58%
=======================================
Files 299 299
Lines 21502 21502
=======================================
Hits 12597 12597
Misses 7983 7983
Partials 922 922 |
|
Whoops; this needs a rebase, because the go1.16 update was merged |
Ah yes indeed, will do that |
911c49e to
ca626e1
Compare
|
@thaJeztah After rebase looks like there are some warnings with golangci-lint which are not visible on CircleCI: Looks linked to golangci/golangci-lint#885. |
e2fcecf to
62d6940
Compare
| fail-fast: false | ||
| matrix: | ||
| target: | ||
| - lint |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The official golangci-lint GitHub Action can also run on Windows, Darwin. Wondering if we can trick it by setting GOOS/GOARCH to also lint non-matching platforms (especially for the CLI, which will be extensively used on macOS and Windows)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes I think we can have a special matrix to run Windows and MacOS runners in this case. We can do that in follow-up.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, it's tricky, because of course we can't run a macOS container, and Windows doesn't support BuildKit for Windows containers (if it would, it's still possible that building takes a long time (Moby Ci can take 10 minutes to build the Dockerfile, a large portion of that is taken by just pulling the base image 😞).
So if it's possible to somehow trick golangci-lint (through GOOS / GOARCH) that would be a lot easier.
If not, then perhaps (for CI) we would have to consider using the official golangci-lint GitHub action, which doesn't (I think?) run containerised, but at least runs fast (and on Windows and macOS). We can still use the BuildKit approach for local use (and for Linux perhaps).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
using the official golangci-lint GitHub action
Yes I think we can do that with https://github.com/golangci/golangci-lint-action for Win/MacOS.
Signed-off-by: CrazyMax <[email protected]>
thaJeztah
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, thanks!
|
@silvin-lubecki PTAL |
silvin-lubecki
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good, thanks @crazy-max !
First step to switch from CircleCI to GitHub Actions for lint.
shellcheckandlintDockerfiles have also been simplified and don't need to be built and run.Have also added new bake targets for that:
docker buildx bake lintormake -f docker.Makefile lintdocker buildx bake shellcheckormake -f docker.Makefile shellcheckcc @thaJeztah
Signed-off-by: CrazyMax [email protected]