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

Use an action cache to improve performance #12

Open
nuke-web3 opened this issue Sep 4, 2023 · 2 comments
Open

Use an action cache to improve performance #12

nuke-web3 opened this issue Sep 4, 2023 · 2 comments

Comments

@nuke-web3
Copy link

https://github.com/actions/cache#cache-action can be used to store the dprint cache in this check action, that radically lessens the load for the action.

As a minimal example: this setup is working nicely for me so far. I have yet to see if the intended behavior (clear cache on update to *dprint.json) is working, but that seems like the most logical thing to signal an update.

The question is, should this action itself allow for use of a cache, optionally? IMHO yes, but perhaps just the example of using the action should include a cache.

@nuke-web3
Copy link
Author

nuke-web3 commented Sep 8, 2023

here is an example of the cache working as expected on update to .dprint.json : https://github.com/Polkadot-Blockchain-Academy/pba-book/actions/runs/6125618243/job/16627953315#step:4:9

Maybe a tiny win, but a win IMHO 😁

@dsherret
Copy link
Member

Yeah, caching can lead to a huge performance improvement (ex. https://david.deno.dev/posts/faster-prettier-with-dprint/)

I just did a release of dprint that fixes a caching issue (https://github.com/dprint/dprint/releases/tag/0.41.0) on GH actions. There is a PR here about updating the docs to indicate how to do caching dprint/dprint#740 but building it directly into the action would probably be good. I'm not sure if it should be turned on by default though. I think probably, with a major release of the action.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants