-
-
Notifications
You must be signed in to change notification settings - Fork 152
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
Better support for go submodules #74
Comments
The workaround is creating a step for every project and using the golangci:
name: lint
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Check golangci-lint for pkgA
uses: golangci/[email protected]
with:
version: v1.29
working-directory: pkgA
args: --modules-download-mode vendor --config ./.golangci.yml ./...
- name: Check golangci-lint for pkgB
uses: golangci/[email protected]
with:
version: v1.29
working-directory: pkgB
args: --modules-download-mode vendor --config ./.golangci.yml ./... |
This is exactly what we are trying to avoid :) |
I am facing the same issue with my monorepo. Seems this is not an issue with the action implementation, but default behaviour of golangci-lint cmd. However, it will be really helpful to have this capability for this to be used seamlessly in a monorepo. |
Here's a rather nice approach for doing this using the |
I added examples for Go workspace and the GitHub Action: https://github.com/golangci/golangci-lint-action?tab=readme-ov-file#how-to-use |
The matrix approach is very wasteful (assuming most cost is in setup and caches are up-to-date) and provides really poor UX in github actions: It would be really great to have this integrated into the action proper and have linting run for each module in parallel. That way it would also make sense to chuck a bit more CPUs at the problem where also setup steps might benefit e.g. by using private runners with more cores. |
Context:
We have a repository which has a structure similar to
root
module has no go files.Each
pkg{A,B,...}
module has code+tests and separate go.mod+go.sum+vendor files.Issue:
On every PR we are running
But it fails with
ERRO Running error: context loading failed: no go files to analyze
Question:
Is there a way to use this action to run linter in all the folders but without creating separate jobs with a matrix?
The text was updated successfully, but these errors were encountered: