restore-virtualenv
                                
                                
                                
                                    restore-virtualenv copied to clipboard
                            
                            
                            
                        [Question] restore env when job fail
Hi @syphar,
I have a question regarding cache configuration. I have noticed that when the job running the action does not end successfully, the cache component is not stored. My suspect is because these jobs are skipped when the job fails

Do you think there is a way to tell the action to cache even if the job fails?
This is because I would like to cache dependencies always when I run my CI. Not just for success jobs
Hi @dtcMLOps ,
this is defined in the action here: https://github.com/syphar/restore-virtualenv/blob/bb833b42c7eba4a9b92e1109bd9fe17500f8f894/action.yml#L9
the main reason back then was simplicity.
To keep in mind: you probably don't want to save the virtualenv when restoring the virtualenv failed.
I'm happy to review a PR, if you find a way to optimise this.
Hi @syphar,
I would suggest having that as an input parameter to the action, something like:
with:
 save-on-fail: true
Regarding this
To keep in mind: you probably don't want to save the virtualenv when restoring the virtualenv failed.
When I am referring to a failed job, it means because it fails for something after the virtualenv, and installation dependencies, e.g.
My CI is as follows

In this case, the project dependencies and the dev dependencies are fine. The job is failing because of flake8. And every time I am running this job to validate flake8, the workflow is installing the dependencies.
Hi @syphar,
I would suggest having that as an input parameter to the action, something like:
with: save-on-fail: true
That's a good idea, I'm happy to review a PR implementing this.
Regarding this
To keep in mind: you probably don't want to save the virtualenv when restoring the virtualenv failed.
When I am referring to a failed job, it means because it fails for something after the virtualenv, and installation dependencies, e.g.
My CI is as follows [...]
In this case, the project dependencies and the dev dependencies are fine. The job is failing because of flake8. And every time I am running this job to validate flake8, the workflow is installing the dependencies.
From what I know the problem is that the action wouldn't be able to differentiate between a failure after restoring from a failure while restoring.