Skip to content

Haskell

Haskell CI on GitHub Actions

GHC recompiles the entire dependency tree on every CI run.

35m → 9m
Cold build
35m → 2m
Warm build

GHC recompiles the entire dependency tree on every CI run.

Why it happens

The Cabal or Stack store is not persisted, and GHC's recompilation checker cannot help across a fresh machine.

What to change

  1. Cache ~/.cabal/store or ~/.stack keyed on the freeze or resolver file
  2. Also cache dist-newstyle or .stack-work for incremental reuse
  3. Pin the GHC version explicitly — a bump invalidates everything
  4. Use a 16 vCPU runner and -j to parallelise across packages

Haskell on runnerhut

yaml
jobs:
build:
runs-on: runnerhut-16vcpu-ubuntu-2404
steps:
- uses: actions/checkout@v4
- uses: haskell-actions/setup@v2
with: { ghc-version: '9.8' }
- run: cabal build all -j
A working starting point

The only runnerhut-specific line is `runs-on: runnerhut-16vcpu-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.