Skip to content

C++

C++ CI on GitHub Actions

Every translation unit recompiles even when nothing relevant changed.

28m → 6m
Full build
28m → 90s
Incremental
88%
ccache hit

Every translation unit recompiles even when nothing relevant changed.

Why it happens

No compiler cache is configured, so ccache or sccache cannot short-circuit identical compilations.

What to change

  1. Add ccache or sccache and persist its cache directory between runs
  2. Use ninja rather than make — the dependency graph is faster and more parallel
  3. Cache vcpkg or Conan package directories keyed on the manifest
  4. Build on a 32 vCPU runner; C++ compilation parallelises almost perfectly

C++ on runnerhut

yaml
jobs:
build:
runs-on: runnerhut-32vcpu-ubuntu-2404
steps:
- uses: actions/checkout@v4
- uses: hendrikmuhs/ccache-action@v1
- run: cmake -B build -G Ninja -DCMAKE_C_COMPILER_LAUNCHER=ccache
- run: cmake --build build --parallel
A working starting point

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