libsdl-org / setup-sdl

GitHub action for providing SDL.
The Unlicense
26 stars 3 forks source link

Cache SDL builds #2

Closed madebr closed 1 year ago

madebr commented 1 year ago

This is implemented since caf33264642a3af89723f3b55f05436196460248, but there is always a cache hit due to version mismatch.

I've asked at https://github.com/orgs/community/discussions/58342

FtZPetruska commented 1 year ago

This seems to be an issue with how cache.restoreCache works. It seems like the function should be given a copy of the paths to avoid version mismatch, as such:

const found_cache_key = await cache.restoreCache(
  Array.from(CACHE_PATHS), // or CACHE_PATHS.slice()
  CACHE_KEY
);

See:

madebr commented 1 year ago

Many many thanks @FtZPetruska I've applied your suggestion in https://github.com/madebr/setup-sdl/commit/f9125121cc36c689d94cb1dcc3305d1cb45dfe54 and the action is now blazing fast! Woohoo!