diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index bafe68f..59fe987 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -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') }} 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