Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

write cache if job fails #38

Open
brettmc opened this issue Jan 15, 2024 · 0 comments
Open

write cache if job fails #38

brettmc opened this issue Jan 15, 2024 · 0 comments
Assignees
Labels
enhancement New feature or request

Comments

@brettmc
Copy link

brettmc commented Jan 15, 2024

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 like gacts/run-and-post-run (ensuring it runs after cache write), check each step for failure if [ ${{steps.step1.outcome == 'failure'}} || steps.stepN.outcome == 'failure' ]; then exit 1; fi and 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

@brettmc brettmc added the enhancement New feature or request label Jan 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants