Protobuf and gRPC
Protobuf and gRPC CI on GitHub Actions
Code generation runs on every build even when no .proto changed.
70s → 6s
Codegen
Code generation runs on every build even when no .proto changed.
Why it happens
protoc plugins are installed per run and generation is not gated on proto changes.
What to change
- Cache the protoc plugin binaries keyed on their versions
- Use buf with a lockfile so dependency modules are cached
- Gate generation on a path filter for **/*.proto
- Check generated code into the repository and verify it in CI rather than regenerating
Protobuf and gRPC on runnerhut
yaml
jobs: generate: runs-on: runnerhut-4vcpu-ubuntu-2404 steps: - uses: actions/checkout@v4 - uses: bufbuild/buf-action@v1 with: { setup_only: true } - run: buf generate && git diff --exit-codeThe 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.