-
Notifications
You must be signed in to change notification settings - Fork 433
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 cache go mod for faster builds in Github Task? #121
Comments
The way we do this in Kubernetes is with a script which wraps I suppose this repo could volume-mount those to the in-container equivalent place. I don't have a lot of free time in the near future to try it, but if you want to try it, that's how I would go.
|
@thockin does your solution prevent the download of go modules in Github task/action as well without committing the vendor? |
I took a quick look at this, and I am confused: It already does a volume-mount for these, or it thinks it does. The
That SHOULD cause the Go module cache to be reused across invocations, as long as you don't
So .,..what's not working? |
Yes @thockin it works in local setup. But it was needed in CI - github task. The same command with the cache wont work, as the github task does not have a stateful disk option between multiple invocations |
Do GitHub actions have a module cache which spans runs? That would surprise me a little bit. Seems like an opportunity for one user to poison another. In theory we could change this to look for these variables explicitly, and if it finds them bind them out those instead. But I'm I'm a little skeptical about this. What about permissions? |
Since we mount the code everytime in a fresh container, the fresh container in github task has no cache of go mod.
make push
becomes slow sometimes due to the network getting choked downloading the same thing.What can we add support to fix this?
We do not vendor check in our org at present so this is a major concern.
The text was updated successfully, but these errors were encountered: