Skip to content

Commit cc65615

Browse files
committed
ci: Fix Composer caching
1 parent 417f6b9 commit cc65615

1 file changed

Lines changed: 7 additions & 8 deletions

File tree

.github/workflows/php.yml

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -16,17 +16,16 @@ jobs:
1616
with:
1717
php-version: '8.5'
1818

19-
- name: Validate composer.json and composer.lock
20-
run: composer validate --strict
21-
22-
- name: Cache Composer packages
19+
- name: Get Composer cache directory
2320
id: composer-cache
21+
run: echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT
22+
23+
- name: Cache dependencies
2424
uses: actions/cache@v4
2525
with:
26-
path: vendor
27-
key: ${{ runner.os }}-php-${{ hashFiles('**/composer.lock') }}
28-
restore-keys: |
29-
${{ runner.os }}-php-
26+
path: ${{ steps.composer-cache.outputs.dir }}
27+
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.json') }}
28+
restore-keys: ${{ runner.os }}-composer-
3029

3130
- name: Install dependencies
3231
run: composer install --prefer-dist --no-progress

0 commit comments

Comments
 (0)