Skip to content

Commit ac87d75

Browse files
committed
chore: only composer install if vendor has not been cached
1 parent bf342a1 commit ac87d75

File tree

1 file changed

+4
-6
lines changed

1 file changed

+4
-6
lines changed

.github/workflows/php.yml

+4-6
Original file line numberDiff line numberDiff line change
@@ -26,18 +26,16 @@ jobs:
2626
php-version: ${{ matrix.php-versions }}
2727
- name: Validate composer.json and composer.lock
2828
run: composer validate --strict
29-
- name: Get Composer Cache Directory
30-
id: composer-cache
31-
run: |
32-
echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT
3329
- name: Cache Composer packages
30+
id: composer-cache
3431
uses: actions/cache@v4
3532
with:
36-
path: ${{ steps.composer-cache.outputs.dir }}
33+
path: vendor
3734
key: ${{ runner.os }}-${{ matrix.php-versions }}-${{ hashFiles('**/composer.lock') }}
3835
restore-keys: |
3936
${{ runner.os }}-${{ matrix.php-versions }}-
4037
- name: Install dependencies
41-
run: composer install --prefer-dist --no-progress
38+
if: steps.composer-cache.outputs.cache-hit != 'true' # Skip if cache hit
39+
run: composer install -q --no-ansi --no-interaction --no-scripts --no-progress --prefer-dist
4240
- name: Run test suite
4341
run: composer run-script test

0 commit comments

Comments
 (0)