Do not cache full environments, only lockfiles #31
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
I've gone back and forth on this a bit, but the issue of unpacking cached environments on windows (#30) is difficult to solve. I've opted for a much simpler caching approach, whereby only a "lockfile"/explicit list of dependencies is cached. This reduces the environment creation time by removing the need for conda to resolve dependencies (since they are all explicitly linked).
It slows things down slightly on linux/MacOS runners, compared to using a fully stored cache, but seems to improve things on Windows. SInce Windows CI runs are our rate limiter, it seems to be an OK compromise.
The other reason to switch to this approach is that it keeps our caches small (~2kb). Caching full environments is more like 200-500mb and that can quickly lead to us reaching our cache limit on repos (10GB) since we get different caches per branch, per OS, per python version, etc.