Skip to content
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

Support storing and restoring cache entries as buffers. #1760

Open
iclanton opened this issue Jun 16, 2024 · 1 comment
Open

Support storing and restoring cache entries as buffers. #1760

iclanton opened this issue Jun 16, 2024 · 1 comment
Labels
cache enhancement New feature or request

Comments

@iclanton
Copy link

Describe the enhancement

The GitHub Actions cache feature currently only supports storing and restoring cache entries that point to files on disk. This works great for things like node_modules folders, and other kinds of data that are produced during an Actions run that are well-known to the pipeline definition, but works less well for build output in complex repos that doesn't follow as predictable a structure, or has structure that is difficult to model in a YAML pipeline.

The Rush monorepo manager has built-in support for caching build output, which is facilitated through plugins that store and retrieve NodeJS Buffers. Rush currently supports remote build cache storage on Azure Storage, Amazon S3, and providers that support generic HTTP operations like Gradle. I've put together a prototype (currently on a branch, not yet in a PR) Rush plugin that adds support for GitHub Actions, but it requires either duplicating a nontrivial amount of code in the @actions/cache package to directly call functions from the @actions/http-client package, or expanded APIs in the @actions/cache package.
 
Code Snippet

I've pushed a branch to my fork of this repo with proposed new APIs in the @actions/cache package. These are currently not exposed from the package's entrypoint. The contributing guide asks that PRs not be raised without prompting, so I haven't opened a PR.

@iclanton
Copy link
Author

I went ahead an opened a PR with the proposed change: #1762

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cache enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants