Multipe Caches will not extract correctly.
elaborate
**Minimal .gitlab-ci.yml illustrating the issue**
```yml
composer-install:
image:
name: ${CI_REGISTRY}/docker/images:php-${PHP_VERSION}-alpine
parallel:
matrix:
- PHP_VERSION: $[[ inputs.php_versions ]]
LARAVEL_VERSION: $[[ inputs.laravel_versions ]]
cache:
- key:
prefix: composer-cache-php${PHP_VERSION}-laravel${LARAVEL_VERSION}
files:
- composer.lock
paths:
- .composer/cache
policy: pull-push
- key:
prefix: composer-vendor-php${PHP_VERSION}-laravel${LARAVEL_VERSION}
files:
- composer.lock
paths:
- vendor/
policy: push
```
```yml
laravel-pint:
image:
name: ${CI_REGISTRY}/docker/images:php-$[[ inputs.php_version ]]-alpine
interruptible: true
needs:
- job: 'composer-install'
cache:
- key:
prefix: $[[ inputs.composer_vendor_cache_prefix ]]
files:
- composer.lock
paths:
- vendor/
policy: pull
```
```yml
composer-install-v2:
image:
name: ${CI_REGISTRY}/docker/images:php-${PHP_VERSION}-alpine
parallel:
matrix:
- PHP_VERSION: $[[ inputs.php_versions ]]
LARAVEL_VERSION: $[[ inputs.laravel_versions ]]
cache:
- key:
prefix: composer-vendor-php${PHP_VERSION}-laravel${LARAVEL_VERSION}
files:
- composer.lock
paths:
- vendor/
policy: push
- key:
prefix: composer-cache-php${PHP_VERSION}-laravel${LARAVEL_VERSION}
files:
- composer.lock
paths:
- .composer/cache
policy: pull-push
```
**Expected behavior**
If i use the fist job composer-install with my laravel pint, the vendor folder nevers get extracted. If i use the workaround version composer-install-v2, it works fine. all i did was ensured cache key that i need was in the first position. this was a easy work around, but for other scenarios where i have more cache's and different jobs need different caches, this workaround does not work.
**Host information**
Ubuntu 24.04.4 LTS (linux subsystem)
gitlab-ci-local 4.67.0
**Containerd binary**
Docker
**Additional context**
Add any other context about the problem here.
1 条评论