Add caching to a workflow
Use your setup action’s cache option or a compatibleactions/cache step. The published cache guide includes complete Node.js and Python workflows and measured results.
For a Python project with a committed requirements.txt that includes pytest, save this workflow as .github/workflows/python-tests.yml. First complete the CI quickstart for the repository.
.github/workflows/python-tests.yml
Verify reuse
Run the workflow successfully, then rerun it with the same dependency file. Inspect the cache step for restore and save messages. A cache hit means a matching archive was found; compare the complete job duration to see whether it saves time. A miss means the job needs to fetch dependencies again. Check the key, saved paths, access scope, and expiry. Keep installation steps able to recover from a miss. Usefail-on-cache-miss only when you intentionally want a missing cache to fail the job.
Caches created on GitHub-hosted runners remain in GitHub’s separate store. Expect an initial miss when moving a workflow to Celesto.
Understand access and expiry
Celesto scopes entries to the workspace, repository, Git ref (a branch or pull-request reference), and cache version. The version describes details such as saved paths and compression. Matching text keys alone do not grant access: Celesto checks the running job’s GitHub runtime token. A read-only cache grant cannot save entries.
These defaults can change. An hourly cleanup removes idle entries, then the least recently used entries as needed to meet storage limits. Expiry is therefore not an exact deletion timestamp. A restore updates the last-access time.
The current cache release has no separate storage charge. Job runtime still consumes workspace credit. Use artifacts or durable storage for results you need to keep.
Start with a fresh cache
In the example above, changepip-v1 to pip-v2 in both key and every restore-keys prefix. Commit the change and run the workflow. Updating all fallback prefixes prevents restoration through the old prefix.
This bypasses old entries while they remain subject to normal cleanup. It does not delete them. Keep tokens, credentials, and private keys out of cached paths.
Request deletion
GitHub’s cache page andgh cache manage GitHub’s store. Celesto currently handles early cache deletion through support and has no customer cache list or delete interface.
Email aniket@celesto.ai with:
