Cache Dependencies¶
When to Use This Guide¶
Use this guide to speed up a workflow by reusing installed dependencies between runs.
Step 1: Enable caching¶
For Python, add cache: 'pip' to the setup step:
It caches your packages, keyed on requirements.txt.
How it behaves¶
- First run: saves the cache (a miss).
- Later runs: restores it if
requirements.txtis unchanged (a hit). - If
requirements.txtchanges: it rebuilds the cache.
Common Issues¶
Always a cache miss
The cache key is your dependency file. If it keeps changing, the cache keeps rebuilding, which is expected.
No speed difference the first time
The first run only saves the cache. The benefit shows from the second run on.