diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index ab4a626..adfa72e 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -48,11 +48,27 @@ jobs: extensions: dom, curl, libxml, mbstring, zip, pcntl, pdo, sqlite, pdo_sqlite, bcmath, soap, intl, gd, exif, iconv, yaml coverage: pcov - - uses: actions/cache@v3.0.5 + - name: Get composer cache directory + id: composer-cache + run: echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT + + - name: Prepare cache key + id: prep + run: | + PHP_VERSION=${{ matrix.php }} + LARAVEL_VERSION=${{ matrix.laravel }} + PREFER_VERSION=${{ matrix.prefer }} + + # Remove any .* from the versions + LARAVEL_VERSION=${LARAVEL_VERSION//.*} + + echo "cache-key=composer-php-$PHP_VERSION-$LARAVEL_VERSION-$PREFER_VERSION-${{ hashFiles('composer.json') }}" >> $GITHUB_OUTPUT + + - uses: actions/cache@v3 name: Cache dependencies with: - path: ~/.composer/cache/files - key: composer-php-${{ matrix.php }}-${{ matrix.laravel }}-${{ matrix.prefer }}-${{ hashFiles('composer.json') }} + path: ${{ steps.composer-cache.outputs.dir }} + key: ${{ steps.prep.outputs.cache-key }} - uses: medyagh/setup-minikube@latest name: Setup Minikube