I’m trying to use yaml anchors in order to override cache policy to specific jobs.
I’m trying to replicate what is documented here.
My pipeline:
image: python:3.9-slim
stages:
- build
default:
cache: &venv_cache
- key:
files:
- Pipfile.lock
paths:
- .cache/
- .venv/
policy: pull
build:
stage: build
cache:
<<: *venv_cache
policy: pull-push
before_script:
- pip install pipenv
script:
- pipenv install --dev --deploy
The error:
This GitLab CI configuration is invalid: jobs:build:cache config contains unknown keys: <<.
Can someone helps me to find out what I am doing wrong ?