-
-
Notifications
You must be signed in to change notification settings - Fork 150
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
How to run go generate before the action? #81
Comments
@steebchen without going much to details, but I think you can just simply run |
Yeah, if I recall correctly, I think that worked – but as I said above, you get bombarded with those error messages. And if you have a lot of dependencies it will spam your logs. I've see a few tens of thousands of lines just filled with those errors since it logs one line per file. So something is wrong with the cache restoration, even though it works in general. Which makes sense, since it probably doesn't expect something modified when restoring the cache. So I would personally classify this more as a bug report or feature request to make go generator work without running into this stream of errors and making the cache restoration work. |
I still feel this is the result of un-compilable codebase, but not the issue with caching or golangci-lint. Maybe related to golangci/golangci-lint#1043 🤔 Personally, I follow alternative approach, which checks in generated file and verifies in github action with |
I'm not sure if I follow. Everything works as intended, the code complies (after go generate is run) and it properly detects errors and fails if there are any, just the cache restoration does not work and results in these errors. I do need to run go generate on each checkout since I don't commit generated code into VCS, but I think that's a perfectly valid workflow. |
hi, what I mean is just fresh clone + go build directly. Thinking about this, I feel like I might have pre-mature assumption, sorry about this. Let me try with your repo some time this week to understand the flow properly 🤔 PS: Seem like the original error messages might not have repo name, can you share or confirm if it's public repo ? |
You can use the repo https://github.com/prisma/prisma-client-go. I'm currently using the raw golangci-lint binary instead of this action and use the github cache action myself. However, I have created steebchen/prisma-client-go#276 to re-create the error; you should be able to inspect the logs from the action there. You can see that the latest test run logs are spammed with error logs since the log restoration didn't work. It's maybe not the best repo to create a reproduction since it does quite a lot of things. In theory any repo which changes the code on |
@sayboras I get the same type of error when I try to use |
Would be great to fix the |
I had the same error using Bazel to generate protobufs. By moving this generation work to another job in the same action file and making golangci-lint job dependent on it with the |
This is #81? |
whoops, thanks. I meant #135 |
duplicated of #135 |
I need to run some code generation before executing the action (
go generate ./...
). How can I do that? It seems it's not possible to do this right now because the action is expected to run without any previous go commands:It seems the action itself works, but the errors don't look very good
The text was updated successfully, but these errors were encountered: