Skip to main content
CI as one automation and a config file: every push and pull request runs on fresh machines created from a snapshot of main’s last green run, and reports a GitHub check. Both files are below.

A push to main: nine 2 vCPU machines, green in under two and a half minutes, saved as the next snapshot. Waits are cut short.

Why run CI on boxd

  • The machine is the cache. Jobs start from a snapshot with the repo, dependencies, build caches and Docker layers in place.
  • No idle runners. Machines exist only while a job runs, metered per second.
  • Parallel by default. Each test shard gets its own machine, with no setup to repeat.
  • Isolated. Job machines hold no credentials, so pull request code can’t reach your organization.
  • A real machine. Docker, systemd and Postgres run normally.

What you build

A push or pull request on GitHub starts a run. boxd creates the job machines, one for the checks and one per test shard, all at once from the snapshot of main's last green run. They post a GitHub check on the commit, and a green run on main is saved as the next snapshot. You need the boxd GitHub App on the repository, and one machine to run the automation on. That machine can sleep: an event wakes it.

1. Snapshot your repo

GitHub triggers the run and shows the result. boxd runs it, with no workflow file and no Actions minutes. Set up a machine the way a job should find it, then save it.
Inside the machine:
Back on your laptop:
You do this once. After that, green runs on main save the next version (step 6).

2. Describe your CI

One entry per repository:
ci.json

3. Start a run on every push and pull request

Subscribe to events through the GitHub App. There is no webhook to host:
ci.run.ts

4. Create a machine per job

Create an isolated machine from the snapshot and check out the commit. The GitHub App token is short-lived and exists only in the fetch command’s environment:
The snapshot already holds main’s checkout, so the fetch brings only the new commits.

5. Run everything at once

One machine for the checks and one per shard, all created together:

A pull request: checks and 8 test shards on nine 2 vCPU machines, green in 145 seconds. Waits are cut short.

Report the result as a check on the commit:

6. Promote a green main

After a green run on main, the machine holds the state the next job should start from. Save it once the result is reported, so nobody waits on the save:
Pull requests never write to the snapshot.
A snapshot can’t be used to create machines while it saves a new version. Keep two names (web-main and web-main-b), save into the idle one, then switch.

7. Turn it on

The config, then the automation started with one command.

Push a commit and follow the run with run logs 2f5c7 -f:

The complete files

Copy both into a folder on one of your machines, edit ci.json, and start with run ci.run.ts.
ci.json
ci.run.ts

How fast is it

On the CI of 10 open-source projects, with 2 vCPU machines everywhere, boxd is 6× faster than one job on a GitHub-hosted runner, 5× faster than one job on Blacksmith and 7× faster than one task on Vercel CI (medians).

CI runner benchmarks

Every project on every platform, one job and sharded, with what a run costs and how it was measured.

Good to know

  • The slowest shard sets the time. Split tests by measured duration, or add shards.
  • More machines, not faster cores. A boxd vCPU is about as fast as a hosted one. The time comes from the snapshot and from shards running side by side.
  • Machine size comes from the snapshot. Jobs get the size of the machine you saved. Resize it before saving to change that.
  • Steps are plain commands. Marketplace actions (uses:) don’t apply.
  • Warm state can hide problems. A dependency removed from package.json can still be in the snapshot, so a job passes where a clean clone would fail. Run a cold build regularly, for example nightly, to catch that.