Cache

Make actions/cache save and restore on RaftRun, with your own retention and storage.

With the cache on, actions/cache, and the setup actions that use it, save to and restore from RaftRun's storage instead of GitHub's. Your workflows don't change: the same steps, keys and restore keys work as they are.

Beta

The cache is off until an admin turns it on. If a restore misbehaves, turn it off and jobs go back to GitHub's cache on their next run.

Turn it on

In the dashboard, open Settings → Cache, switch on Accelerated cache, and save. The next job on a RaftRun machine uses it.

.github/workflows/test.yml
steps:
  - uses: actions/checkout@v4
  - uses: actions/cache@v4
    with:
      path: ~/.cargo/registry
      key: cargo-${{ hashFiles('Cargo.lock') }}
      restore-keys: cargo-
  - run: cargo test

Setup actions with a cache option go through the same cache:

steps
steps:
  - uses: actions/checkout@v4
  - uses: actions/setup-node@v4
    with:
      node-version: 22
      cache: npm

How entries are shared

  • By repository. Every branch and pull request of a repository sees the same entries. GitHub limits a branch to its own and its base branch's entries; RaftRun does not.
  • Exact key first, then restore keys, newest match first, as on GitHub.
  • Entries are never overwritten. Saving a key that already exists is skipped, so put a hash of your lockfile in the key.
Shared across branches

A pull request's branch can restore what the default branch saved, and the default branch can restore what a pull request saved. Don't cache anything secret, and don't trust a cache to be clean in a release build.

Storage and retention

  • Entries unused for the retention period are deleted. It is 14 days unless you change it in Settings → Cache.
  • On RaftRun's storage you get your plan's allowance (Solo 10 GB, Team 50 GB, Business 150 GB), plus any extra you buy at $10 a month per 100 GB. When it is full, the least recently used entries are deleted. Nothing is billed by surprise.
  • The Cache page lists entries by repository, with their size and when they were last used. Clear a whole repository or one entry there.

Rust builds

RaftRun machines can cache Rust builds for you. It works through mbx, which stores each crate's compiled output and restores it when the same crate is built again with the same inputs, on any machine. Turn on Cache Rust builds in Settings: your machines then come with mbx and Rust installed, and plain cargo builds through the cache. Your workflows stay as they are.

.github/workflows/test.yml
steps:
  - uses: actions/checkout@v4
  - uses: dtolnay/rust-toolchain@stable
  - run: cargo test --workspace
  • By repository. Each repository has its own cache. No other repository or workspace can read it or write to it.
  • Written from pushes to the default branch. Only a push to the repository's default branch saves outputs; pull requests and other runs read without writing.
  • The first build of a repository fills it. mbx finds outputs through what it recorded for your Cargo.lock, so the first build compiles everything, and later ones, on any machine, restore what didn't change.
  • Kept for 30 days, within your size limit. Outputs are removed 30 days after they were saved, and the oldest go first once the workspace passes the size you set. The next push to the default branch saves them again.
  • A cache problem never fails a build. If the cache can't be reached, cargo compiles everything itself.
  • Your own AWS credentials come first. The machine hands mbx its key the way EC2 hands out an instance role's. Once a step exports AWS credentials, as aws-actions/configure-aws-credentials does, mbx uses those instead, and later steps build without the cache. Build before that step, or in a separate job.
Release builds

Build what you publish without the cache: run ~/.cargo/bin/cargo build --release, which goes straight to Cargo.

Use your own bucket

Keep the cache in any S3-compatible bucket you own, such as AWS S3, Cloudflare R2, Tigris or Backblaze B2. It costs nothing on RaftRun's side and the size cap is yours to set.

  1. Make a key for that bucket only

    It needs to read, write and delete objects in the bucket, and nothing else.

  2. Connect it

    On the Cache page, press Use your own bucket and give the endpoint, region, bucket and key. RaftRun writes, reads and deletes a test object before saving, then stores the secret encrypted.

New entries go to your bucket from then on. Entries already saved stay usable until they expire.