Prune ccache caches in CI on each run #457
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
I noticed in a recent build that the cache size for Windows is quite large at 500M. That might be related to switching to MSVC, I'm not sure, but something else I've realized is that as-configured wasi-sdk will continuously grow the cache over time and it won't ever get trimmed until we hit github actions limits. This is because the cache is restored from an older version, then appended to with the current build, then saved again. That theoretically means that each builder could make up to a 5G cache which is a bit too large.
This commit adds an extra step that removes all objects older than 1d to ensure that older builds eventually get cleaned out of the cache. GitHub Actions should then still delete older caches pretty regularly but each individual cache should be bounded still.