bazel-contrib / rules-template

A template for creating a new Bazel ruleset
Apache License 2.0
82 stars 22 forks source link

build: fix ci cacheing to use recently built caches #4

Closed kormide closed 2 years ago

kormide commented 2 years ago

@alexeagle

Github actions caches don't update already existing caches, so the cache that gets loaded could be old. This sets a new cache using a cache key derived from a hash of files. The use of restore-keys: bazel-cache- will find the most recent cache stored scoped to this branch or a parent branch.

kormide commented 2 years ago

Updated. @alexeagle I wrote a more verbose (but hopefully clearer) explanation. @f0rmiga I removed the cache location flags outside of the bazelrc file as it doesn't support environment variables.