Closed jrfnl closed 2 years ago
Something about the cache_key_08.exp test is causing a failure, but I can't tell what it is yet.
Something about the cache_key_08.exp test is causing a failure, but I can't tell what it is yet.
Windows and file permissions. Should be fixed now.
Hmm.. Composer v1 still giving trouble...
(which is weird as I had a passing build before I tidied up and rebased)
@ramsey As by now it's not the new test which is failing, could you restart the build just to check it wasn't some Composer hick-up ?
Re-running
Merging #239 (6f57711) into v2 (7f9021e) will increase coverage by
0.02%
. The diff coverage is100.00%
.
Right first round done: applied this in some 40 repos ;-)
For anyone looking for some more date-based example code:
- name: Install Composer dependencies
uses: ramsey/composer-install@v2
with:
# Bust the cache at least once every three months - output format: YYYYqQ, example: 2022q4.
custom-cache-suffix: $(/bin/date +%Y)q$(( ($(/bin/date +%-m)-1)/3+1 ))
- name: Install Composer dependencies
uses: ramsey/composer-install@v2
with:
# Bust the cache at least once a month - output format: YYYY-MM-DD.
custom-cache-suffix: $(date -u -d "-0 month -$(($(date +%d)-1)) days" "+%F")
- name: Install Composer dependencies
uses: ramsey/composer-install@v2
with:
# Bust the cache at least once a week - output format: YYYY-MM-DD.
custom-cache-suffix: $(/bin/date -u --date='last Mon' "+%F")
Simplified version of the "once a month" code sample:
- name: Install Composer dependencies
uses: ramsey/composer-install@v2
with:
# Bust the cache at least once a month - output format: YYYY-MM.
custom-cache-suffix: $(date -u "+%Y-%m")
Description
As discussed in #234.
This adds a new
custom-cache-suffix
option to the action which allows for adding a custom addition to the cache key, which can be helpful to break out of outdated caches, especially when a project does not have a committedcomposer.lock
file.Fixes #234
Motivation and context
See #234
How has this been tested?
Both unit tests as well as integration tests are included with the PR.
Types of changes
PR checklist