Make WordPress Core

Changeset 52179 for trunk/phpcs.xml.dist


Ignore:
Timestamp:
11/16/2021 02:17:26 PM (3 years ago)
Author:
desrosj
Message:

Build/Test Tools: Cache the results of PHP_CodeSniffer across workflow runs.

When the PHP_CodeSniffer runs, it produces a cache file. When a cache file is present, only changed files are rescanned, making subsequent scans significantly faster.

This adds the needed steps to the corresponding GitHub Actions workflows to cache these files across runs. The cache keys include the date of the previous Monday to ensure that the cache is flushed at least weekly.

Since GitHub Action caches cannot be updated once created, the scans will take slightly longer as the week progresses and more PHP files are updated. The date within the cache key can be updated to purge twice weekly if the scan time starts to approach the current scan times.

This change also introduces a .cache directory for all caching files related to build/test tools.

Props johnbillion, jrf.
Fixes #49783.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/phpcs.xml.dist

    r51659 r52179  
    77
    88    <!-- Whenever possible, cache the scan results and re-use those for unchanged files on the next scan. -->
    9     <arg name="cache"/>
     9    <arg name="cache" value=".cache/phpcs.json"/>
    1010
    1111    <!-- Set the memory limit to 256M.
Note: See TracChangeset for help on using the changeset viewer.