Fix CI caching
brylie opened this issue · 4 comments
Idea summary
Ensure our CI can use cached versions of Poetry.
Further details
Our CI is supposed to use cache for Poetry. However, there never seems to be a cache hit, meaning Poetry is installed with each CI run.
Task
- enable the CI pipeline to use a cached Poetry installation
Hello @brylie,
I am interested in this issue.
But I am not sure to understand the issue here. Several actions logs show actual use of dependencies cached and reuse.(ex: https://github.com/CiviWiki/OpenCiviWiki/actions/runs/3184602940). So only poetry is reinstalled each time. not the dependencies.
But there is no actual cache for poetry installation itself.
So is the idea to add such a support?
And if so, Do we want to replace the actual cache with one that includes poetry and looks for changes in both project.toml
and poetry.lock
files?
Ah, I didn't see the dependency cache hits, probably because we've been changing dependencies lately.
It would be nice to re-use our Poetry install, if possible. What do you think?
I think is is a good idea, but I am wondering about consequences to have 2 caching systems: one for poetry and one for other dependencies installed by poetry.
In case of a change in poetry (that should not happen quite often) I think we would like to also reinstall dependencies even is poetry.pock hasn't changed.
So maybe having one caching with poth poetry and dependencies is acceptable.
I guess the choice might depend on the complexity of the solution. You may not want something too complex for a low gain.
I will look into it and see what I can do.
I noticed that the Poetry step takes only around 15 seconds, so it isn't too much of a burden. However, it is probably worth caching Poetry to save CPU resources and energy.