Make WordPress Core


Ignore:
Timestamp:
01/05/2021 07:21:50 PM (4 years ago)
Author:
desrosj
Message:

Build/Test Tools: Simplify Composer package caching.

This simplifies the caching of Composer dependencies in the coding standards and PHP compatibility workflows by using a published action. This combines 3 steps into 1 within these workflows.

Because the Composer implementation within the PHPUnit test workflow is a bit specialized (composer install is run within the Docker container), caching has been left as is in that workflow. However, the cache key has been changed to include the version of PHP being tested. This will prevent incorrect versions of dependencies being present when they are required on jobs other than PHP 8.

Props jrf.
See #50401.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/.github/workflows/phpunit-tests.yml

    r49835 r49938  
    192192        with:
    193193          path: ${{ steps.composer-cache.outputs.dir }}
    194           key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }}
     194          key: ${{ runner.os }}-php-${{ matrix.php }}-composer-${{ hashFiles('**/composer.lock') }}
    195195          restore-keys: |
    196             ${{ runner.os }}-composer-
     196            ${{ runner.os }}-php-${{ matrix.php }}-composer-
    197197
    198198      - name: Install Composer dependencies
Note: See TracChangeset for help on using the changeset viewer.