diff --git a/.github/workflows/coding-standard.yml b/.github/workflows/coding-standard.yml index 6afd99e7..7db2b01e 100644 --- a/.github/workflows/coding-standard.yml +++ b/.github/workflows/coding-standard.yml @@ -34,14 +34,20 @@ jobs: php-version: "${{ matrix.php-version }}" ini-values: memory_limit=-1 - - name: "Cache dependencies" - uses: "actions/cache@v2" + - name: Get Composer cache directory + id: composer-cache + run: echo "::set-output name=dir::$(composer config cache-dir)" + + - name: Cache dependencies + uses: actions/cache@v2 with: - path: | - ~/.composer/cache - vendor - key: "php-${{ matrix.php-version }}-${{ matrix.dependencies }}" - restore-keys: "php-${{ matrix.php-version }}-${{ matrix.dependencies }}" + path: ${{ steps.composer-cache.outputs.dir }} + key: composer-${{ runner.os }}-${{ matrix.php-version }}-${{ hashFiles('composer.*') }}-${{ matrix.dependencies }} + restore-keys: | + composer-${{ runner.os }}-${{ matrix.php-version }}-${{ hashFiles('composer.*') }}- + composer-${{ runner.os }}-${{ matrix.php-version }}- + composer-${{ runner.os }}- + composer- - name: "Install lowest dependencies" if: ${{ matrix.dependencies == 'lowest' }} diff --git a/.github/workflows/phar-creation.yml b/.github/workflows/phar-creation.yml index d07bb957..64c0d610 100644 --- a/.github/workflows/phar-creation.yml +++ b/.github/workflows/phar-creation.yml @@ -32,14 +32,20 @@ jobs: php-version: "${{ matrix.php-version }}" ini-values: memory_limit=-1, phar.readonly=0 - - name: "Cache dependencies" - uses: "actions/cache@v2" + - name: Get Composer cache directory + id: composer-cache + run: echo "::set-output name=dir::$(composer config cache-dir)" + + - name: Cache dependencies + uses: actions/cache@v2 with: - path: | - ~/.composer/cache - vendor - key: "php-${{ matrix.php-version }}-${{ matrix.dependencies }}" - restore-keys: "php-${{ matrix.php-version }}-${{ matrix.dependencies }}" + path: ${{ steps.composer-cache.outputs.dir }} + key: composer-${{ runner.os }}-${{ matrix.php-version }}-${{ hashFiles('composer.*') }}-${{ matrix.dependencies }} + restore-keys: | + composer-${{ runner.os }}-${{ matrix.php-version }}-${{ hashFiles('composer.*') }}- + composer-${{ runner.os }}-${{ matrix.php-version }}- + composer-${{ runner.os }}- + composer- - name: "Install lowest dependencies" if: ${{ matrix.dependencies == 'lowest' }} diff --git a/.github/workflows/phpstan.yml b/.github/workflows/phpstan.yml index d42b0729..1e9891d9 100644 --- a/.github/workflows/phpstan.yml +++ b/.github/workflows/phpstan.yml @@ -34,14 +34,20 @@ jobs: php-version: "${{ matrix.php-version }}" ini-values: memory_limit=-1 - - name: "Cache dependencies" - uses: "actions/cache@v2" + - name: Get Composer cache directory + id: composer-cache + run: echo "::set-output name=dir::$(composer config cache-dir)" + + - name: Cache dependencies + uses: actions/cache@v2 with: - path: | - ~/.composer/cache - vendor - key: "php-${{ matrix.php-version }}-${{ matrix.dependencies }}" - restore-keys: "php-${{ matrix.php-version }}-${{ matrix.dependencies }}" + path: ${{ steps.composer-cache.outputs.dir }} + key: composer-${{ runner.os }}-${{ matrix.php-version }}-${{ hashFiles('composer.*') }}-${{ matrix.dependencies }} + restore-keys: | + composer-${{ runner.os }}-${{ matrix.php-version }}-${{ hashFiles('composer.*') }}- + composer-${{ runner.os }}-${{ matrix.php-version }}- + composer-${{ runner.os }}- + composer- - name: "Install lowest dependencies" if: ${{ matrix.dependencies == 'lowest' }} diff --git a/.github/workflows/phpunit.yml b/.github/workflows/phpunit.yml index 183a1da2..eb220edf 100644 --- a/.github/workflows/phpunit.yml +++ b/.github/workflows/phpunit.yml @@ -37,14 +37,20 @@ jobs: php-version: "${{ matrix.php-version }}" ini-values: memory_limit=-1 - - name: "Cache dependencies" - uses: "actions/cache@v2" + - name: Get Composer cache directory + id: composer-cache + run: echo "::set-output name=dir::$(composer config cache-dir)" + + - name: Cache dependencies + uses: actions/cache@v2 with: - path: | - ~/.composer/cache - vendor - key: "php-${{ matrix.php-version }}-${{ matrix.dependencies }}" - restore-keys: "php-${{ matrix.php-version }}-${{ matrix.dependencies }}" + path: ${{ steps.composer-cache.outputs.dir }} + key: composer-${{ runner.os }}-${{ matrix.php-version }}-${{ hashFiles('composer.*') }}-${{ matrix.dependencies }} + restore-keys: | + composer-${{ runner.os }}-${{ matrix.php-version }}-${{ hashFiles('composer.*') }}- + composer-${{ runner.os }}-${{ matrix.php-version }}- + composer-${{ runner.os }}- + composer- - name: "Install lowest dependencies" if: ${{ matrix.dependencies == 'lowest' }} diff --git a/.github/workflows/psalm.yml b/.github/workflows/psalm.yml index 0de83e8a..561772a2 100644 --- a/.github/workflows/psalm.yml +++ b/.github/workflows/psalm.yml @@ -36,14 +36,20 @@ jobs: php-version: "${{ matrix.php-version }}" ini-values: memory_limit=-1 - - name: "Cache dependencies" - uses: "actions/cache@v2" + - name: Get Composer cache directory + id: composer-cache + run: echo "::set-output name=dir::$(composer config cache-dir)" + + - name: Cache dependencies + uses: actions/cache@v2 with: - path: | - ~/.composer/cache - vendor - key: "php-${{ matrix.php-version }}-${{ matrix.dependencies }}" - restore-keys: "php-${{ matrix.php-version }}-${{ matrix.dependencies }}" + path: ${{ steps.composer-cache.outputs.dir }} + key: composer-${{ runner.os }}-${{ matrix.php-version }}-${{ hashFiles('composer.*') }}-${{ matrix.dependencies }} + restore-keys: | + composer-${{ runner.os }}-${{ matrix.php-version }}-${{ hashFiles('composer.*') }}- + composer-${{ runner.os }}-${{ matrix.php-version }}- + composer-${{ runner.os }}- + composer- - name: "Install lowest dependencies" if: ${{ matrix.dependencies == 'lowest' }} diff --git a/.github/workflows/require-checker.yml b/.github/workflows/require-checker.yml index 30c78015..fa4ea81a 100644 --- a/.github/workflows/require-checker.yml +++ b/.github/workflows/require-checker.yml @@ -34,14 +34,20 @@ jobs: php-version: "${{ matrix.php-version }}" ini-values: memory_limit=-1 - - name: "Cache dependencies" - uses: "actions/cache@v2" + - name: Get Composer cache directory + id: composer-cache + run: echo "::set-output name=dir::$(composer config cache-dir)" + + - name: Cache dependencies + uses: actions/cache@v2 with: - path: | - ~/.composer/cache - vendor - key: "php-${{ matrix.php-version }}-${{ matrix.dependencies }}" - restore-keys: "php-${{ matrix.php-version }}-${{ matrix.dependencies }}" + path: ${{ steps.composer-cache.outputs.dir }} + key: composer-${{ runner.os }}-${{ matrix.php-version }}-${{ hashFiles('composer.*') }}-${{ matrix.dependencies }} + restore-keys: | + composer-${{ runner.os }}-${{ matrix.php-version }}-${{ hashFiles('composer.*') }}- + composer-${{ runner.os }}-${{ matrix.php-version }}- + composer-${{ runner.os }}- + composer- - name: "Install lowest dependencies" if: ${{ matrix.dependencies == 'lowest' }}