The details behind sharing a Composer cache across GitHub Actions test jobs

DanielLockyer · x · 2026-11-22

Follow-up from DanielLockyer with the full GitHub PR details behind the Composer cache-sharing change: each test previously spun up a fresh COMPOSERHOME via createTestEnvironment(), leaving the cache empty and forcing re-downloads of Packagist metadata and archives. The PR sets COMPOSERCACHEDIR to .cache/composer via putenv() in tests/bootstrap.php — effective locally and in CI, leaves pre-set values alone — and adds /.cache/ to .gitignore (the cache only holds zip and JSON files, so PHPCS and the linter won't pick it up).

Related event: Sharing Composer cache across CI tests speeds up PHPUnit integration tests by 31%(2 posts)→

Original post →

More from coding & agent

coding & agent channel →