carpentries / sandpaper

User Interface for The Carpentries Workbench
https://carpentries.github.io/sandpaper
Other
41 stars 26 forks source link

Duplicate caching in `R-CMD-check` and `test-coverage` actions #591

Open milanmlft opened 1 month ago

milanmlft commented 1 month ago

Hi sandpaper devs!

I noticed while working on a fork of sandpaper that the CI is producing quite a lot of caches on the GitHub Action runners. Upon further inspection, I think this is due because there are 2 caching steps happening in the R-CMD-check and test-coverage actions:

  1. The custom "Restore {renv} cache" step
  2. The "Setup dependencies" step which calls setup-r-dependencies from r-lib

The problem is that setup-r-dependencies does its own caching by default.

I think they're meant to cache pretty much the same thing (R dependencies of sandpaper), though I'm not sure why the renv caches are typically bigger. In any case I think you only need one of them and having both can eat up quite a lot of caching storage space (might want to check this for the Carpentries organisation).

I'd suggest removing the Restore {renv} cache step (and the dependent Prime {renv} Cache) and let setup-r-dependencies handle the caching. That would also reduce the amount of code to maintain for thesandpaper` devs 😉

Happy to create a PR for this!