feat: add an option for repository-local caching #52
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR adds a feature to store Deno installation to repository-local cache with
@actions/cache
, which generally speeds up the workflow.I believe it should be the default behavior, but it's turned off by default in this PR for safety.
I also modified log messages to make the difference between runner's cache of tools and repository-local caching clear, since I find it a little bit confusing that setup-deno always downloads Deno from remote regardless of saying "Cached Deno to ...".
I refered to setup-zig for implementation: https://github.com/goto-bus-stop/setup-zig
Not sure the best way to test the feature, but I turned on the feature only for
matrix.deno == "~1.32"
, since addingcache = [true, false]
to the matrix seems too much.You can see the result of tests on my forked repository: https://github.com/hasundue/setup-deno/actions/runs/6634339100
The first run is without cache in the first place, and the second run hits the caches. We can see some difference in the step duration as expected.