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

Cache only if compile step succeeds #149

Open
shi-scala opened this issue May 29, 2023 · 2 comments
Open

Cache only if compile step succeeds #149

shi-scala opened this issue May 29, 2023 · 2 comments

Comments

@shi-scala
Copy link

I've noticed an issue, where if the compilation step fails for any reason, the cache is still created.
Since created caches are not overwritten, partial builds are written and can not be overwritten.

I can use some combination of append-timestamp and restore-keys but this feels awkward and brittle.

Is there a way to signal ccache-action to only save if an env variable is set or something similar?

@hendrikmuhs
Copy link
Owner

That's by design: #4

The cache doesn't work like a build, a cache is:

  1. restored (from a previous build)
  2. updated during build
  3. written back

If an error occurs in step 2, the cache still contains the cache objects from step 1, the previous, potentially successful build.

@shi-scala
Copy link
Author

Is there a way I can signal ccache-action not to cache results in case of failure?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants