HackIllinois / api

The Official API supporting HackIllinois
https://api.hackillinois.org
Other
23 stars 51 forks source link

Add caching to CI build job #520

Closed Nydauron closed 1 year ago

Nydauron commented 1 year ago

Adds caching to CI job to allow for faster runtime.

Timothy-Gonzalez commented 1 year ago

This looks good so far, but we still need to cache go dependencies.

Timothy-Gonzalez commented 1 year ago

The fact that some tests cache now is an extremely good sign, that's almost a minute shaved off. It also means adding unit tests will be much much much faster.

It seems like the go installer does caching to, but that doesn't prevent it from downloading the mods again? There's some weird conflict going on but it does work.

Timothy-Gonzalez commented 1 year ago

Okay, so the goinstall action has issues with caching actual dependencies, and one of the recommended solutions is to do it manually instead. I'm going to try that.

Timothy-Gonzalez commented 1 year ago

Under a minute with no changes! That's pretty good. Mostly is just mongo starting now, which I'm guessing can't be cached. Still looks very promising.

Nydauron commented 1 year ago

Okay, so the goinstall action has issues with caching actual dependencies, and one of the recommended solutions is to do it manually instead.

Huh weird that an actions/cache is required even though it literally says on the actions/setup-go README that it uses actions/cache under-the-hood.

Either way looks great!

Timothy-Gonzalez commented 1 year ago

Huh weird that an actions/cache is required even though it literally says on the actions/setup-go README that it uses actions/cache under-the-hood.

Either way looks great!

I looked into it a bit more, it's because the setup-go caches only the go pkg directory, but not go's cache directory. Either way, it works, so that's good enough for me!