Closed NixBiks closed 4 years ago
Since these steps run as two different containers, I'm honestly not sure if we can do any caching between the two. Have you seen any examples of this on any other projects?
I've been trying to get the cache action to play with poetry, but I'm not sure where the virtual environments are being stored in this action.
I've been trying to get the cache action to play with poetry, but I'm not sure where the virtual environments are being stored in this action.
I've been calling poetry config virtualenvs.in-project true
which puts the virtualenv in .venv
It's not ideal, but seems to work. I'd prefer if I could do it a better way.
I've been trying to get the cache action to play with poetry, but I'm not sure where the virtual environments are being stored in this action.
@marcosfelt
Looks like the default location for the poetry virtualenv is under ~/.cache/pypoetry
That being said, because this action works as its own container, it doesn't benefit from the same caching that the usual action cache enables.
If you want to use the official cache action to play nicely, you'll need to install Poetry using this (or similar) action: https://github.com/marketplace/actions/setup-poetry#cache-dependencies-to-speed-up-workflows
Instead of running poetry in its own container, the setup-poetry
action installs poetry to the actual GitHub Action runner host environment, which is where the cache actions store things as well.
The setup-*
pattern seems to be more or less become the standard pattern these days as well.
Good job on a very simple api for this action.
Is it possible to add some caching though? In your example python is being installed twice even. It would be nice if the environment would be cached between pushes so only the testing would be run on pushes (unless there is a dependency or similar change of course)