-
Notifications
You must be signed in to change notification settings - Fork 1
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
Unable to cache more than one version of buf #71
Comments
Hi @jeffj254, the buf-action allows for installing Buf by other means then the GitHub action and then checks that version matches the intended. The second install is using the path provided by the previous, so a workaround would be to alter the path removing the buf toolcache before invoking the second one. If other actions always install into the toolcache I think this behaviour should be revisited for consistency. Could you expand more on why you require multiple versions of buf to be added to the toolcache? |
We provide self-hosted runners to many different dev teams who may require different versions of tools. To improve build times and reduce bandwidth usage we will cache commonly used versions on our ephemeral runner image so they do not require a download for every job. For example we cache Node 16, 20, and 22. We would like to do the same with buf and cache a few different versions, but right now the action does not allow you to "setup" more than one version. |
This avoids requiring the version of Buf found in the PATH to match the resolved. Fallback to installing a new explicit version in the toolcache. Fixes #71
@jeffj254 released in v1.0.2! |
We use self-hosted runners with a hostedtoolcache of various tools and versions that our developers use. We build the cache following GitHub's recommendation here: https://docs.github.com/en/[email protected]/admin/managing-github-actions-for-your-enterprise/managing-access-to-actions-from-githubcom/setting-up-the-tool-cache-on-self-hosted-runners-without-internet-access
The process is pretty simple, you basically just call the
setup-
actions for whatever tools you need and then tarball up the hostedtoolcache directory. Extract that into your runner image build and off you go.When I try to do this with buf I get an error while trying to setup the second version that the requested version doesn't match what is in the PATH. Is it possible to add an additional parameter to allow a second version to be cached?
example workflow:
Error message with this workflow:
The text was updated successfully, but these errors were encountered: