cache-extensions
cache-extensions copied to clipboard
write cache if job fails
Describe the feature
I would like to be able to cache extensions even if the job fails (perhaps optionally, via a cache-on-error: <bool> option)
Version
- [ x] I have checked releases and the feature is missing in the latest patch version of
v1.
Underlying issue Testing a library against PHP nightly, I expect it to fail a lot (ie during composer install, tests, linting, etc). But, that doesn't mean the extensions weren't created correctly, and I would like to avoid recompiling them each run.
Describe alternatives
- make all steps
continue-on-error. Then, cache will be written. However, the job now reports as being successful even with failed steps. - make all steps
continue-on-error, then use an action likegacts/run-and-post-run(ensuring it runs after cache write), check each step for failureif [ ${{steps.step1.outcome == 'failure'}} || steps.stepN.outcome == 'failure' ]; then exit 1; fiand then fail at the end. This works, but is a little tedious. - add an
if: always()condition to the cache-extensions step (does not work)
Additional context
Are you willing to submit a PR? Yes