diff --git a/.cache/.gitkeep b/.cache/.gitkeep new file mode 100644 index 000000000000..e69de29bb2d1 diff --git a/.github/workflows/coding-standards.yml b/.github/workflows/coding-standards.yml index 95e2af01721d..a5b1e53f212d 100644 --- a/.github/workflows/coding-standards.yml +++ b/.github/workflows/coding-standards.yml @@ -48,6 +48,7 @@ jobs: # - Checks out the repository. # - Sets up PHP. # - Logs debug information. + # - Configures caching for PHPCS scans. # - Installs Composer dependencies (use cache if possible). # - Make Composer packages available globally. # - Logs PHP_CodeSniffer debug information. @@ -75,6 +76,18 @@ jobs: php --version composer --version + # This date is used to ensure that the PHPCS cache is cleared at least once every week. + # http://man7.org/linux/man-pages/man1/date.1.html + - name: "Get last Monday's date" + id: get-date + run: echo "::set-output name=date::$(/bin/date -u --date='last Mon' "+%F")" + + - name: Cache PHPCS scan cache + uses: actions/cache@26968a09c0ea4f3e233fdddbafd1166051a095f6 # v2.1.4 + with: + path: .cache/phpcs.json + key: ${{ runner.os }}-date-${{ steps.get-date.outputs.date }}-phpcs-cache-${{ hashFiles('**/composer.json') }} + - name: Install Composer dependencies uses: ramsey/composer-install@92a7904348d4ad30236f3611e33b7f0c6f9edd70 # v1.1.0 with: diff --git a/.github/workflows/php-compatibility.yml b/.github/workflows/php-compatibility.yml index 82202829ef53..6848465b5028 100644 --- a/.github/workflows/php-compatibility.yml +++ b/.github/workflows/php-compatibility.yml @@ -20,7 +20,7 @@ on: - '**.php' # These files configure Composer. Changes could affect the outcome. - 'composer.*' - # This file configures PHP Compatibility scanning. Changes could affect the outcome. + # This file configures PHP compatibility scanning. Changes could affect the outcome. - 'phpcompat.xml.dist' # Changes to workflow files should always verify all workflows are successful. - '.github/workflows/*.yml' @@ -42,7 +42,8 @@ jobs: # Performs the following steps: # - Checks out the repository. # - Sets up PHP. - # - Logs debug information about the runner container. + # - Logs debug information. + # - Configures caching for PHP compatibility scans. # - Installs Composer dependencies (use cache if possible). # - Make Composer packages available globally. # - Logs PHP_CodeSniffer debug information. @@ -69,6 +70,18 @@ jobs: php --version composer --version + # This date is used to ensure that the PHP compatibility cache is cleared at least once every week. + # http://man7.org/linux/man-pages/man1/date.1.html + - name: "Get last Monday's date" + id: get-date + run: echo "::set-output name=date::$(/bin/date -u --date='last Mon' "+%F")" + + - name: Cache PHP compatibility scan cache + uses: actions/cache@26968a09c0ea4f3e233fdddbafd1166051a095f6 # v2.1.4 + with: + path: .cache/phpcompat.json + key: ${{ runner.os }}-date-${{ steps.get-date.outputs.date }}-phpcompat-cache-${{ hashFiles('**/composer.json') }} + - name: Install Composer dependencies uses: ramsey/composer-install@92a7904348d4ad30236f3611e33b7f0c6f9edd70 # v1.1.0 with: diff --git a/.gitignore b/.gitignore index ca946e1930c6..4fe178c594c7 100644 --- a/.gitignore +++ b/.gitignore @@ -10,6 +10,7 @@ wp-tests-config.php /phpunit.xml /.phpcs.xml /phpcs.xml +.cache/* /tests/phpunit/data/plugins/wordpress-importer /tests/phpunit/data/.trac-ticket-cache* /tests/qunit/compiled.html diff --git a/phpcompat.xml.dist b/phpcompat.xml.dist index db47b0ea2654..fbc436cf0d29 100644 --- a/phpcompat.xml.dist +++ b/phpcompat.xml.dist @@ -11,7 +11,7 @@ - + - +