Skip to content

Commit e5f5268

Browse files
committed
Fix custom-cache-suffix
1 parent c5a561c commit e5f5268

File tree

2 files changed

+14
-4
lines changed

2 files changed

+14
-4
lines changed

.github/workflows/reusable-functional.yml

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -76,13 +76,18 @@ jobs:
7676
run: |
7777
sudo sed -i 's/^.*policy.*coder.*none.*PDF.*//' /etc/ImageMagick-6/policy.xml
7878
79+
# This date is used to ensure that the PHP compatibility cache is cleared at least once every week.
80+
# http://man7.org/linux/man-pages/man1/date.1.html
81+
- name: "Get last Monday's date"
82+
id: get-date
83+
run: echo "date=$(/bin/date -u --date='last Mon' "+%F")" >> "$GITHUB_OUTPUT"
84+
7985
- name: Install Composer dependencies & cache dependencies
8086
uses: "ramsey/composer-install@65e4f84970763564f46a70b8a54b90d033b3bdda" # v3
8187
env:
8288
COMPOSER_ROOT_VERSION: dev-${{ github.event.repository.default_branch }}
8389
with:
84-
# Bust the cache at least once a month - output format: YYYY-MM.
85-
custom-cache-suffix: $(date -u "+%Y-%m")
90+
custom-cache-suffix: ${{ steps.get-date.outputs.date }}
8691

8792
# MySQL 8.4 requires explicit loading of mysql_native_password plugin
8893
- name: Determine MySQL authentication configuration

.github/workflows/reusable-unit.yml

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,13 +38,18 @@ jobs:
3838
env:
3939
COMPOSER_TOKEN: ${{ secrets.GITHUB_TOKEN }}
4040

41+
# This date is used to ensure that the PHP compatibility cache is cleared at least once every week.
42+
# http://man7.org/linux/man-pages/man1/date.1.html
43+
- name: "Get last Monday's date"
44+
id: get-date
45+
run: echo "date=$(/bin/date -u --date='last Mon' "+%F")" >> "$GITHUB_OUTPUT"
46+
4147
- name: Install Composer dependencies & cache dependencies
4248
uses: "ramsey/composer-install@65e4f84970763564f46a70b8a54b90d033b3bdda" # v3
4349
env:
4450
COMPOSER_ROOT_VERSION: dev-${{ github.event.repository.default_branch }}
4551
with:
46-
# Bust the cache at least once a month - output format: YYYY-MM.
47-
custom-cache-suffix: $(date -u "+%Y-%m")
52+
custom-cache-suffix: ${{ steps.get-date.outputs.date }}
4853

4954
# PHPUnit 10+ may fail a test run when the "old" configuration format is used.
5055
# Luckily, there is a built-in migration tool since PHPUnit 9.3.

0 commit comments

Comments
 (0)