Skip to content

Bun

Bun CI on GitHub Actions

Bun installs quickly but CI still spends a minute on dependencies.

18s → 1.5s
Install
4m → 70s
Full pipeline

Bun installs quickly but CI still spends a minute on dependencies.

Why it happens

Bun's global install cache is not persisted, so its speed advantage is spent re-downloading.

What to change

  1. Cache ~/.bun/install/cache keyed on bun.lockb
  2. Use bun install --frozen-lockfile for reproducibility
  3. Run bun test, which is parallel by default, on a 4 vCPU runner

Bun on runnerhut

yaml
jobs:
test:
runs-on: runnerhut-4vcpu-ubuntu-2404
steps:
- uses: actions/checkout@v4
- uses: oven-sh/setup-bun@v2
- run: bun install --frozen-lockfile
- run: bun test
A working starting point

The only runnerhut-specific line is `runs-on: runnerhut-4vcpu-ubuntu-2404`. Everything else is standard GitHub Actions — the same actions, the same secrets and the same permissions model you use today.

Your next build could be twice as fast, at half the price

Start free. Migrating away is the same one line, and we publish that diff too.