Bogdanp / setup-racket

A GH action for installing Racket.
MIT License
52 stars 9 forks source link

How to use caching with `current` #39

Closed samth closed 3 years ago

samth commented 3 years ago

Is there a good way to use package caching with the "current" version? Ideally I'd like to specify the cache key using the version of Racket we're installing, but I'm not sure how to do that.

Bogdanp commented 3 years ago

Here's an example: https://github.com/Bogdanp/setup-racket-cache-example/blob/829790b6b2700eb200653ead9ce83a44eb019b3d/.github/workflows/push.yml#L28-L54

The trick is to install Racket first, then bake its version into the key via hashFiles. The .racket-version file has to go into the $GITHUB_WORKSPACE folder, otherwise hashFiles won't be able to read it.

samth commented 3 years ago

Thanks!