Comments (6)
If we're able to use something like this, it'd work nicely:
- name: Cache composer packages
uses: actions/cache@preview
with:
path: ~/.composer/cache/files
key: composer-${{ date('yyyy') }}-${{ date('mm') }}-${{ date('dd') }}-${{ github.sha }}
restore-keys: |
composer-${{ date('yyyy') }}-${{ date('mm') }}-${{ date('dd') }}-
composer-${{ date('yyyy') }}-${{ date('mm') }}-
composer-${{ date('yyyy') }}-
composer-
from cache.
Or does the fallback order already use the most recent key first?
from cache.
Hey @teohhanhui, I see you closed this issue, did you get this figured out?
from cache.
I think it works just fine assuming that the fallback always uses the most recent cache key (so there's no need for a date
function, though that might still be useful for other use cases).
But indeed it'd be great to have an additive cache (updating an existing cache key). In the case of composer, it means we could share the same cache in different jobs with different stability level for the dependencies (e.g. normal, lowest deps, and unstable).
from cache.
@teohhanhui You are correct, the fallback selects the most recently created cache that matches the restore key prefix.
from cache.
We should have docs coming soon with more details. If you want the date, you do something with action outputs like:
- name: Set an output
id: get-date
run: |
echo ::set-output name=date::$(/bin/date -u "+%Y%m%d")
- name: Use the output
run: |
echo 'The output date is ${{ steps.get-date.outputs.date }}'
see the docs on outputs.
But as @dhadka said, you should be fine the fallback as is
from cache.
Related Issues (20)
- - [ ] curl -v -X POST https://api-m.sandbox.paypal.com/v2/checkout/orders/<order_id>/capture \ -H "Content-Type: application/json" \ -H "Authorization: Bearer ACCESS-TOKEN"
- Cache miss when restoring within a reusable workflow HOT 3
- * @actions/actions-cache
- BornNk
- Cache miss on Windows despite a successful cache-write HOT 4
- How to do fine-grained caching: bulk APIs?
- Add `--remove-files`to avoid running out of space
- Emit a warning instead of a silent failure when zstd is missing
- Warning: Failed to restore: downloadCache failed: unable to verify the first certificate HOT 5
- Cocoapods example should cache the system cache rather than build products
- Support for leveraging cache across scopes on demand
- Can not access cache from Linux runner on Mac runner
- What is the default `upload-chunk-size`?
- Cache miss for restore-keys: `setup-java-...`
- Cache restored successfully = sf: command not found
- Cache service responded with 503
- Version 3.3.2 fails to save cache on self-hosted windows runner HOT 2
- Missing cache in containerized job when using v3 HOT 2
- `lookup-only` doesn't with `cache-hit`
- Cache clearerx
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from cache.