This utility repository periodically runs a GitHub Action that pulls the latest actions/cache repository and applies a rather simple patch to all of its actions:
const omniCacheAddress = process.env["OMNI_CACHE_ADDRESS"];
const httpCacheHost = process.env["CIRRUS_HTTP_CACHE_HOST"];
const cacheAddress = omniCacheAddress ?? httpCacheHost;
if (cacheAddress != null) {
const newActionsCacheURL = `http://${cacheAddress}/`;
console.log(
`Redefining the ACTIONS_CACHE_URL to ${newActionsCacheURL} to make the cache faster...`
);
process.env["ACTIONS_CACHE_URL"] = newActionsCacheURL;
process.env["ACTIONS_RESULTS_URL"] = newActionsCacheURL;
}This allows jobs on Cirrus Runners or self-hosted runners to use a faster cache backend.
Cirrus Runners run an omni-cache sidecar instance by default, making the changes in your CI workflows as simple as:
-- uses: actions/cache@v5
+- uses: cirruslabs/cache@v5
with:
path: node_modules
key: node_modulesIf running outside of Cirrus Runners, simply use setup-omni-cache action to start an omni-cache sidecar before caching:
steps:
- name: Setup omni-cache
uses: cirruslabs/setup-omni-cache@main
with:
bucket: ci-omni-cache
s3-endpoint: ${{ secrets.S3_ENDPOINT }} # can be R2 or any other S3-compatible storage
env:
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
AWS_REGION: us-east-1
- name: Cache node modules
uses: cirruslabs/cache@v5
with:
path: node_modules
key: node_modulesBecause the following PRs were closed/not merged yet: