Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 8 additions & 4 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,17 +37,21 @@ jobs:
- name: Validate composer.json and composer.lock
run: composer validate --strict

- name: Get Composer cache directory
id: composer-cache-dir
run: echo "dir=$(composer config cache-files-dir)" >> "$GITHUB_OUTPUT"

- name: Cache Composer packages
id: composer-cache
uses: actions/cache@v5
with:
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') }}

Copilot AI Mar 27, 2026

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Suggested 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') }}

Copilot uses AI. Check for mistakes.
restore-keys: |
${{ runner.os }}-php-
${{ runner.os }}-php-${{ matrix.php-versions }}-

- name: Install dependencies
run: COMPOSER_ROOT_VERSION=6.0.x-dev composer update --prefer-dist --no-interaction --no-progress ${{ matrix.composer-prefer }}
run: COMPOSER_ROOT_VERSION=6.0.x-dev composer update --prefer-dist --no-interaction --no-progress --prefer-stable ${{ matrix.composer-prefer }}

- name: Run phpstan
run: ./vendor/bin/phpstan analyse
Expand Down
Loading