I tried to use an anchor for a global cache definition but got the following error:
This GitLab CI configuration is invalid: jobs:build:cache config contains unknown keys: <<
Why does anchor not work in this case?
default:
cache: &global_cache
- key: "$CI_COMMIT_REF_NAME"
policy: pull
paths:
- build
- key:
files:
- gradle/wrapper/gradle-wrapper.properties
policy: pull
paths:
- .gradle/wrapper
- .gradle/notifications
build:
cache:
<<: *global_cache
policy: push
stage: build
script: ./gradlew --build-cache assemble
...
Thanks