Skip to content

Keep composer cache in CI cache, instead of installed vendor directory

Jérôme TAMARELLE requested to merge jtamarel/php:patch-1 into master

Benefits:

  • When a branch changes the contents of vendors (updates or adds dependency in composer.lock), composer has to re-download everything that changed. That appends a lot with multiple branches having a distinct composer.lock
  • If the composer.lock is not committed, composer have to download json manifests from packagist. Keeping the cache of these files offloads packagist and speedup dependency resolution.

Downsides:

  • composer have to extract the cached archives into vendor directory on each build (a lot faster that an actual download)
  • cache directory grows with each dependency version and may need to be cleaned.

Documentation will be updated once this PR get merged. https://docs.gitlab.com/ce/ci/examples/php.html#using-composer

Edited by Jérôme TAMARELLE

Merge request reports