Skip to content

Improve Bazel cache behavior: restrict writes to pushes and add optional disk-cache input for QNX workflow#56

Merged
4og merged 2 commits intomainfrom
bazel-cache-cleanup
Jan 28, 2026
Merged

Improve Bazel cache behavior: restrict writes to pushes and add optional disk-cache input for QNX workflow#56
4og merged 2 commits intomainfrom
bazel-cache-cleanup

Conversation

@4og
Copy link
Member

@4og 4og commented Jan 28, 2026

This PR improves Bazel caching behavior across the workflows:

  • Prevents Bazel cache writes from pull requests to avoid polluting shared Github cache.
  • Upgrades bazel-contrib/setup-bazel to v0.18.0.
  • Disables caching for very small workflows (copyright, format) that don't benefit from Bazel cache. The caching provided by the bazel-contrib/setup-bazel is very coarse, and saving the cache from such workflows would just make other workflows not benefiting from Bazel cache either.
  • Adds an optional bazel-disk-cache input to the QNX workflow so callers can supply a custom cache key (string) to separate caches per workflow/target. The hope is to make the caching is a bit more useful. Unfortunately it's not possible to modify the cache key for repository cache. The issues in setup-bazel are discussed in Update disk cache on cache hits bazel-contrib/setup-bazel#18 and Should all caches, not just disk-cache, take custom keys? (or one universal key for all caches) bazel-contrib/setup-bazel#73

4og added 2 commits January 27, 2026 18:55
- Upgrade bazel-contrib/setup-bazel to v0.18.0
- Set cache-save to only write on push events to prevent pull requests from polluting the Bazel cache
- Disable caching for copyright and format as it doesn't bring much for these simple workflows, but polutes github cache
By introducing a parameter, workflows can now pass a custom string to use
as cache key for workflow separation.
@4og
Copy link
Member Author

4og commented Jan 28, 2026

The changes are tested with eclipse-score/baselibs#84

@4og 4og merged commit 4769532 into main Jan 28, 2026
2 checks passed
@4og 4og deleted the bazel-cache-cleanup branch January 28, 2026 14:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Development

Successfully merging this pull request may close these issues.

2 participants