Skip to content

pnpm

pnpm CI on GitHub Actions

pnpm install is fast locally but slow in CI.

65s → 6s
Install
3m → 12s
Monorepo install

pnpm install is fast locally but slow in CI.

Why it happens

The pnpm content-addressed store lives outside the project and is not cached, so every package downloads again.

What to change

  1. Cache the pnpm store path returned by pnpm store path
  2. Install with --frozen-lockfile for reproducibility
  3. Use the store cache rather than caching node_modules — it deduplicates across workspaces

pnpm on runnerhut

yaml
jobs:
test:
runs-on: runnerhut-4vcpu-ubuntu-2404
steps:
- uses: actions/checkout@v4
- uses: pnpm/action-setup@v4
- uses: actions/setup-node@v4
with: { node-version: 22, cache: pnpm }
- run: pnpm install --frozen-lockfile
- run: pnpm 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.