crystal-lang / install-crystal

GitHub Action: Install Crystal programming language
https://crystal-lang.github.io/install-crystal/configurator.html
MIT License
67 stars 8 forks source link

Caching #2

Closed saltycrys closed 3 years ago

saltycrys commented 3 years ago

Hello,

Invidious now uses this action to install Crystal, see https://github.com/iv-org/invidious/blob/eb6d3d68a9ed880fe0e3e4b6404925d0f4a4c5ad/.github/workflows/ci.yml. I tried to set up caching for Crystal but couldn't figure it out. Is caching possible? I noticed that Crystal needs some dependencies that might be hard to cache.

If caching is possible could you please add support for it in this action?

oprypin commented 3 years ago

What exactly should be cached?

saltycrys commented 3 years ago

The Crystal binary and all of its dependencies.

oprypin commented 3 years ago

Crystal is already being downloaded from GitHub's own servers, everything is pre-packaged, so there is little to no advantage to caching it, because even a cache is also just a download from GitHub's servers.

saltycrys commented 3 years ago

Yeah, it would only save six seconds. Is there a way to install a statically linked Crystal instead?

oprypin commented 3 years ago

So indeed, installing Ubuntu packages is the slower part of this. No, I am not aware of any statically linked Crystal build.

saltycrys commented 3 years ago

Okay. In that case there's no way of caching. Six seconds is not a huge deal anyways.

Thank you for this great action! It is very helpful because the Crystal container ships with a git version too old for the checkout action. So instead of doing a git clone it downloads the sources using the GitHub API, which breaks the usage of git commands in builds.