bazel-contrib / rules-template

A template for creating a new Bazel ruleset
Apache License 2.0
78 stars 20 forks source link

bazel cache paths aren't working in ci.yaml #38

Closed dastbe closed 1 year ago

dastbe commented 1 year ago

Note: fix for this already exists in #35 , just providing additional context.

After forking this, I noticed that the cache actions were failing to persist with the following error

Warning: Path Validation Error: Path(s) specified in the action for caching do(es) not exist, hence no cache is being saved.

Which was surprising because these paths do, in fact, exist! After reading the yaml docs on how the vertical bar operator works, my understanding is that

path: "~/.cache/bazel"

results in

~/.cache/bazel

in github's action processor, whereas

path: |
  "~/.cache/bazel"
  "~/.cache/bazel-repo"

results in

"~/.cache/bazel"
"~/.cache/bazel-repo"

because it doesn't unquote, and the processor isn't handling that at all. Switching to

path: |
  ~/.cache/bazel
  ~/.cache/bazel-repo

fixes the caching.

kormide commented 1 year ago

Thanks for documenting this. Closing as fixed in https://github.com/bazel-contrib/rules-template/pull/35.