feat(php): pre-warm Composer cache with common dependencies
Some checks failed
Build CI Images / go-1.26 (push) Failing after 4s
Build CI Images / php-8.3 (push) Failing after 4s
Build CI Images / php-8.4 (push) Failing after 4s

Installs laravel/framework, livewire, pint, pest, and testbench into
the Composer cache during build. CI jobs hit local cache instead of
downloading ~48MB of packages per run.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
Claude 2026-02-23 14:43:06 +00:00
parent cb3a6d42ec
commit cba829fbdd
No known key found for this signature in database
GPG key ID: AF404715446AEB41

View file

@ -12,5 +12,16 @@ RUN apt-get update && apt-get install -y --no-install-recommends \
# Composer
COPY --from=composer:2 /usr/bin/composer /usr/bin/composer
# Pre-warm Composer cache with common dependencies across all core/php-* repos.
# This means `composer install` in CI hits local cache instead of downloading.
RUN mkdir /tmp/warmup && cd /tmp/warmup \
&& composer init --name=lthn/warmup --no-interaction \
&& composer config allow-plugins.pestphp/pest-plugin true \
&& composer config allow-plugins.phpstan/extension-installer true \
&& composer require --no-interaction --prefer-dist \
laravel/framework livewire/livewire \
laravel/pint pestphp/pest orchestra/testbench \
&& rm -rf /tmp/warmup
# Verify
RUN php -v && composer --version