Skip to content

Commit

Permalink
feat(composer-install): improve speed
Browse files Browse the repository at this point in the history
- now caches vendor instead of composer cache
  • Loading branch information
EdieLemoine committed May 18, 2022
1 parent fb19db3 commit 9a8f314
Showing 1 changed file with 7 additions and 11 deletions.
18 changes: 7 additions & 11 deletions composer-install/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,21 +25,17 @@ runs:
php-version: ${{ inputs.php-version }}
tools: ${{ inputs.tools }}

- name: 'Get Composer cache directory'
shell: bash
id: composer-cache
run: |
echo "::set-output name=dir::$(composer config cache-files-dir)"
- name: 'Handle Composer cache'
uses: actions/cache@v2
- name: 'Prepare Composer cache'
uses: actions/cache@v3
id: cache
with:
path: ${{ steps.composer-cache.outputs.dir }}
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }}
path: vendor
key: ${{ runner.os }}-composer-vendor-${{ hashFiles('**/composer.lock') }}
restore-keys: |
${{ runner.os }}-composer-
${{ runner.os }}-composer-vendor-
- name: 'Install composer dependencies'
if: steps.cache.outputs.cache-hit != 'true'
shell: bash
run: |
composer install --no-interaction --no-progress ${{ inputs.flags }}

0 comments on commit 9a8f314

Please sign in to comment.