data icon indicating copy to clipboard operation
data copied to clipboard

Github Actions artifact caching

Open runspired opened this issue 5 years ago • 5 comments

We currently have two categories of assets for which a cache would significantly improve the run times of our actions-based PR checks. The actions/cache that Github provides is ideal for this.

  • [x] node_modules

We should cache node_modules by hashing our yarn.lock file. This would allow commits that do not change the lock file to reuse the same assets easily.

Example: https://github.com/actions/cache/blob/master/examples.md#node---yarn

  • [ ] Production Build Dists

We should cache the built dist artifacts from yarn workspace ember-data ember build -e production. These should be cached by SHA. Most commonly commits comparing themselves to master will reuse SHAs on master (AssetSizeCheck, Tracerbench perf analysis), but also we currently do production builds for the SHA being tested by the AssetSizeCheck as well as for running tests in production. We should be able to build once for both jobs.

runspired avatar Nov 05 '19 19:11 runspired

@runspired is there an easy way to bust the cache? I have some ptsd from cached node_modules

igorT avatar Nov 07 '19 00:11 igorT

@igorT we would likely use an ENV for that. It’s a good question for the actions team though I’ll ask them.

runspired avatar Nov 07 '19 00:11 runspired

How would that work? Lets say a test suspiciously fails, I would make a new commit with a flag?

igorT avatar Nov 07 '19 00:11 igorT

Probably. There’s a lot of things we could do. We could also write an action that we manually trigger from the UI to purge all caches I think, need to check on that.

runspired avatar Nov 07 '19 00:11 runspired

We mostly have this infra in place now, but would love someone to finish polishing it up and getting it over the line

runspired avatar Nov 17 '22 03:11 runspired