Change the management of the cache of composer

This commit is contained in:
Guilhem Niot 2021-06-07 18:52:44 +02:00
parent 5808651c19
commit ce6ed1ee80

View File

@ -15,7 +15,6 @@ on:
env: env:
fail-fast: true fail-fast: true
COMPOSER_ROOT_VERSION: "1.4"
jobs: jobs:
phpunit: phpunit:
@ -48,14 +47,19 @@ jobs:
uses: "shivammathur/setup-php@v2" uses: "shivammathur/setup-php@v2"
with: with:
php-version: "${{ matrix.php-version }}" php-version: "${{ matrix.php-version }}"
tools: composer
coverage: "none" coverage: "none"
- name: "Cache dependencies installed with composer" - name: Get composer cache directory
uses: "actions/cache@v2" id: composercache
run: echo "::set-output name=dir::$(composer config cache-files-dir)"
- name: Cache dependencies
uses: actions/cache@v2
with: with:
path: "~/.composer/cache" path: ${{ steps.composercache.outputs.dir }}
key: "php-${{ matrix.php-version }}-composer-locked-${{ hashFiles('composer.lock') }}" key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.json') }}
restore-keys: "php-${{ matrix.php-version }}-composer-locked-" restore-keys: ${{ runner.os }}-composer-
- name: "Install dependencies with composer" - name: "Install dependencies with composer"
env: env: