From 688d1edf88efa0c48738a1ec8e2b1da577aa8ee6 Mon Sep 17 00:00:00 2001 From: Jonathan Desrosiers <359867+desrosj@users.noreply.github.com> Date: Tue, 17 Mar 2026 23:41:16 -0400 Subject: [PATCH 1/2] Simplify Composer-related caching. --- .../workflows/reusable-check-built-files.yml | 9 +-------- .../reusable-coding-standards-php.yml | 10 ++-------- .../workflows/reusable-php-compatibility.yml | 10 ++-------- .../reusable-phpstan-static-analysis-v1.yml | 20 +++++++------------ 4 files changed, 12 insertions(+), 37 deletions(-) diff --git a/.github/workflows/reusable-check-built-files.yml b/.github/workflows/reusable-check-built-files.yml index 11d97639a30fc..2b3af18e9cc5d 100644 --- a/.github/workflows/reusable-check-built-files.yml +++ b/.github/workflows/reusable-check-built-files.yml @@ -17,7 +17,6 @@ jobs: # Performs the following steps: # - Checks out the repository. # - Sets up Node.js. - # - Configures caching for Composer. # - Installs Composer dependencies. # - Logs general debug information about the runner. # - Installs npm dependencies. @@ -47,18 +46,12 @@ jobs: node-version-file: '.nvmrc' cache: npm - # 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 "date=$(/bin/date -u --date='last Mon' "+%F")" >> "$GITHUB_OUTPUT" - # Since Composer dependencies are installed using `composer update` and no lock file is in version control, # passing a custom cache suffix ensures that the cache is flushed at least once per week. - name: Install Composer dependencies uses: ramsey/composer-install@65e4f84970763564f46a70b8a54b90d033b3bdda # v4.0.0 with: - custom-cache-suffix: ${{ steps.get-date.outputs.date }} + custom-cache-suffix: $(/bin/date -u --date='last Mon' "+%F") - name: Log debug information run: | diff --git a/.github/workflows/reusable-coding-standards-php.yml b/.github/workflows/reusable-coding-standards-php.yml index d03344b769ce7..8052b32f6d4f7 100644 --- a/.github/workflows/reusable-coding-standards-php.yml +++ b/.github/workflows/reusable-coding-standards-php.yml @@ -58,26 +58,20 @@ jobs: coverage: none tools: cs2pr - # 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 "date=$(/bin/date -u --date='last Mon' "+%F")" >> "$GITHUB_OUTPUT" - - name: Cache PHPCS scan cache uses: actions/cache@cdf6c1fa76f9f475f3d7449005a359c84ca0f306 # v5.0.3 with: path: | .cache/phpcs-src.json .cache/phpcs-tests.json - key: ${{ runner.os }}-date-${{ steps.get-date.outputs.date }}-php-${{ inputs.php-version }}-phpcs-cache-${{ hashFiles('**/composer.json', 'phpcs.xml.dist') }} + key: ${{ runner.os }}-date-$(/bin/date -u --date='last Mon' "+%F")-php-${{ inputs.php-version }}-phpcs-cache-${{ hashFiles('**/composer.json', 'phpcs.xml.dist') }} # Since Composer dependencies are installed using `composer update` and no lock file is in version control, # passing a custom cache suffix ensures that the cache is flushed at least once per week. - name: Install Composer dependencies uses: ramsey/composer-install@65e4f84970763564f46a70b8a54b90d033b3bdda # v4.0.0 with: - custom-cache-suffix: ${{ steps.get-date.outputs.date }} + custom-cache-suffix: $(/bin/date -u --date='last Mon' "+%F") - name: Make Composer packages available globally run: echo "${PWD}/vendor/bin" >> "$GITHUB_PATH" diff --git a/.github/workflows/reusable-php-compatibility.yml b/.github/workflows/reusable-php-compatibility.yml index 79d75ff207894..ecf1c6449749d 100644 --- a/.github/workflows/reusable-php-compatibility.yml +++ b/.github/workflows/reusable-php-compatibility.yml @@ -56,24 +56,18 @@ jobs: run: | 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 "date=$(/bin/date -u --date='last Mon' "+%F")" >> "$GITHUB_OUTPUT" - - name: Cache PHP compatibility scan cache uses: actions/cache@cdf6c1fa76f9f475f3d7449005a359c84ca0f306 # v5.0.3 with: path: .cache/phpcompat.json - key: ${{ runner.os }}-date-${{ steps.get-date.outputs.date }}-php-${{ inputs.php-version }}-phpcompat-cache-${{ hashFiles('**/composer.json', 'phpcompat.xml.dist') }} + key: ${{ runner.os }}-date-$(/bin/date -u --date='last Mon' "+%F")-php-${{ inputs.php-version }}-phpcompat-cache-${{ hashFiles('**/composer.json', 'phpcompat.xml.dist') }} # Since Composer dependencies are installed using `composer update` and no lock file is in version control, # passing a custom cache suffix ensures that the cache is flushed at least once per week. - name: Install Composer dependencies uses: ramsey/composer-install@65e4f84970763564f46a70b8a54b90d033b3bdda # v4.0.0 with: - custom-cache-suffix: ${{ steps.get-date.outputs.date }} + custom-cache-suffix: $(/bin/date -u --date='last Mon' "+%F") - name: Make Composer packages available globally run: echo "${PWD}/vendor/bin" >> "$GITHUB_PATH" diff --git a/.github/workflows/reusable-phpstan-static-analysis-v1.yml b/.github/workflows/reusable-phpstan-static-analysis-v1.yml index cc83be9c73896..942478536f4b6 100644 --- a/.github/workflows/reusable-phpstan-static-analysis-v1.yml +++ b/.github/workflows/reusable-phpstan-static-analysis-v1.yml @@ -24,8 +24,8 @@ jobs: # Performs the following steps: # - Checks out the repository. # - Sets up PHP. - # - Logs debug information. # - Installs Composer dependencies. + # - Logs debug information. # - Configures caching for PHP static analysis scans. # - Make Composer packages available globally. # - Runs PHPStan static analysis (with Pull Request annotations). @@ -58,11 +58,12 @@ jobs: coverage: none tools: cs2pr - # This date is used to ensure that the Composer 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 "date=$(/bin/date -u --date='last Mon' "+%F")" >> "$GITHUB_OUTPUT" + # Since Composer dependencies are installed using `composer update` and no lock file is in version control, + # passing a custom cache suffix ensures that the cache is flushed at least once per week. + - name: Install Composer dependencies + uses: ramsey/composer-install@65e4f84970763564f46a70b8a54b90d033b3bdda # v4.0.0 + with: + custom-cache-suffix: $(/bin/date -u --date='last Mon' "+%F") - name: General debug information run: | @@ -70,13 +71,6 @@ jobs: node --version composer --version - # Since Composer dependencies are installed using `composer update` and no lock file is in version control, - # passing a custom cache suffix ensures that the cache is flushed at least once per week. - - name: Install Composer dependencies - uses: ramsey/composer-install@65e4f84970763564f46a70b8a54b90d033b3bdda # v4.0.0 - with: - custom-cache-suffix: ${{ steps.get-date.outputs.date }} - - name: Make Composer packages available globally run: echo "${PWD}/vendor/bin" >> "$GITHUB_PATH" From f6f554bdd52bd8cd8b27da29a004f9456b15bb56 Mon Sep 17 00:00:00 2001 From: Jonathan Desrosiers <359867+desrosj@users.noreply.github.com> Date: Tue, 17 Mar 2026 23:47:49 -0400 Subject: [PATCH 2/2] Inputs do not handles all text literally. --- .github/workflows/reusable-coding-standards-php.yml | 10 ++++++++-- .github/workflows/reusable-php-compatibility.yml | 10 ++++++++-- 2 files changed, 16 insertions(+), 4 deletions(-) diff --git a/.github/workflows/reusable-coding-standards-php.yml b/.github/workflows/reusable-coding-standards-php.yml index 8052b32f6d4f7..d03344b769ce7 100644 --- a/.github/workflows/reusable-coding-standards-php.yml +++ b/.github/workflows/reusable-coding-standards-php.yml @@ -58,20 +58,26 @@ jobs: coverage: none tools: cs2pr + # 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 "date=$(/bin/date -u --date='last Mon' "+%F")" >> "$GITHUB_OUTPUT" + - name: Cache PHPCS scan cache uses: actions/cache@cdf6c1fa76f9f475f3d7449005a359c84ca0f306 # v5.0.3 with: path: | .cache/phpcs-src.json .cache/phpcs-tests.json - key: ${{ runner.os }}-date-$(/bin/date -u --date='last Mon' "+%F")-php-${{ inputs.php-version }}-phpcs-cache-${{ hashFiles('**/composer.json', 'phpcs.xml.dist') }} + key: ${{ runner.os }}-date-${{ steps.get-date.outputs.date }}-php-${{ inputs.php-version }}-phpcs-cache-${{ hashFiles('**/composer.json', 'phpcs.xml.dist') }} # Since Composer dependencies are installed using `composer update` and no lock file is in version control, # passing a custom cache suffix ensures that the cache is flushed at least once per week. - name: Install Composer dependencies uses: ramsey/composer-install@65e4f84970763564f46a70b8a54b90d033b3bdda # v4.0.0 with: - custom-cache-suffix: $(/bin/date -u --date='last Mon' "+%F") + custom-cache-suffix: ${{ steps.get-date.outputs.date }} - name: Make Composer packages available globally run: echo "${PWD}/vendor/bin" >> "$GITHUB_PATH" diff --git a/.github/workflows/reusable-php-compatibility.yml b/.github/workflows/reusable-php-compatibility.yml index ecf1c6449749d..79d75ff207894 100644 --- a/.github/workflows/reusable-php-compatibility.yml +++ b/.github/workflows/reusable-php-compatibility.yml @@ -56,18 +56,24 @@ jobs: run: | 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 "date=$(/bin/date -u --date='last Mon' "+%F")" >> "$GITHUB_OUTPUT" + - name: Cache PHP compatibility scan cache uses: actions/cache@cdf6c1fa76f9f475f3d7449005a359c84ca0f306 # v5.0.3 with: path: .cache/phpcompat.json - key: ${{ runner.os }}-date-$(/bin/date -u --date='last Mon' "+%F")-php-${{ inputs.php-version }}-phpcompat-cache-${{ hashFiles('**/composer.json', 'phpcompat.xml.dist') }} + key: ${{ runner.os }}-date-${{ steps.get-date.outputs.date }}-php-${{ inputs.php-version }}-phpcompat-cache-${{ hashFiles('**/composer.json', 'phpcompat.xml.dist') }} # Since Composer dependencies are installed using `composer update` and no lock file is in version control, # passing a custom cache suffix ensures that the cache is flushed at least once per week. - name: Install Composer dependencies uses: ramsey/composer-install@65e4f84970763564f46a70b8a54b90d033b3bdda # v4.0.0 with: - custom-cache-suffix: $(/bin/date -u --date='last Mon' "+%F") + custom-cache-suffix: ${{ steps.get-date.outputs.date }} - name: Make Composer packages available globally run: echo "${PWD}/vendor/bin" >> "$GITHUB_PATH"