generated from renoki-co/laravel-package-skeleton
-
-
Notifications
You must be signed in to change notification settings - Fork 60
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix: Cache key with wildcard never hits
Noticing the cache isn't hitting when action runs. Remove hardcoded composer cache directory. Remove wildcard .* in Laravel version as part of cache key. Bump actions/cache to 3.3.1 (via @V3).
- Loading branch information
Showing
1 changed file
with
19 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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/[email protected] | ||
- 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 | ||
|