Conversation
There was a problem hiding this comment.
Pull request overview
Updates the GitHub Actions CI workflow to improve Composer dependency handling by caching Composer’s download cache (instead of vendor) and making dependency resolution more stable across runs.
Changes:
- Add a step to detect and cache the Composer cache directory via
composer config cache-files-dir. - Update the Composer cache key/restore key strategy to incorporate matrix dimensions.
- Add
--prefer-stableto the Composer update command.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| path: vendor | ||
| key: ${{ runner.os }}-php-${{ hashFiles('**/composer.lock') }} | ||
| path: ${{ steps.composer-cache-dir.outputs.dir }} | ||
| key: ${{ runner.os }}-php-${{ matrix.php-versions }}-${{ matrix.composer-prefer }}-${{ hashFiles('composer.json') }} |
There was a problem hiding this comment.
The Composer cache key is based on hashFiles('composer.json') only. When dependency versions change via composer.lock (including indirect updates), the key can still hit, and Actions Cache will not save newly downloaded packages on a cache hit—reducing cache effectiveness after lockfile changes. Consider including composer.lock (or both composer.json + composer.lock) in the key hash so cache entries rotate when resolved versions change.
| key: ${{ runner.os }}-php-${{ matrix.php-versions }}-${{ matrix.composer-prefer }}-${{ hashFiles('composer.json') }} | |
| key: ${{ runner.os }}-php-${{ matrix.php-versions }}-${{ matrix.composer-prefer }}-${{ hashFiles('composer.json', 'composer.lock') }} |
No description provided.