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
make it possible to set the GOOS / GOARCH #742
Comments
I think a better solution is to use an OS matrix: jobs:
golangci-lint:
name: Linter
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
steps:
// ... |
Not really. You pay the cost of booting the VM, checking out the code, setting up Go, for a linting fast that just takes a few seconds. It also means that you can only lint the code for the 3 platforms that GH actions is offering. I need to support FreeBSD, among others, so this doesn’t work at all. |
When the binary is built, it is built for a GOOS/ARCH tuple, some elements of the std or dependencies can be missing. The basic core can work because it's related to Go tooling, but I cannot provide any warranty about the behavior when playing with GOOS/ARCH to run golangci-lint. In this context adding options to play with GOOS/ARCH seems risky. |
I think your current approach based on env vars is the best approach to handle your use case. For other users: I recommend NOT doing that as explain here. |
Welcome
Description of the problem
I have a lot of platform-specific in quic-go. So far, I've been running golangci-lint on Ubuntu, thus only the code for Linux has been linted.
I discovered that in the terminal, it's easily possible to run golangci-lint for other platforms as well:
As you might be able to expected, the code for the other platforms was not properly linted. I therefore would like to run golangci-lint using multiple platforms on CI. As far as I can see, there's no way to set the GOOS / GOARCH as a config flag.
As a workaround, this is how you could achieve the same result:
I suggest adding config flags to make this more accessible:
Does this make sense?
Version of golangci-lint
v1.52.2
Version of the GitHub Action
v3
Workflow file
see above
Go version
1.20
Code example or link to a public repository
https://github.com/quic-go/quic-go/blob/22d6b0e626c56f311ff05705042d8caf506e5919/.github/workflows/lint.yml#L24-L35
The text was updated successfully, but these errors were encountered: