← Back to blog

Rendering Every Board on Every Push: A Small KiCad CI Pipeline

Brandon Schaefer··Updated November 24, 2026·5 min read·

The small Gitea Actions pipeline that turns a push to a hardware repo into fresh schematic, board, and 3D-render images automatically, and the real edge cases that showed up trying to only re-render what actually changed.

Table of contents

Last post I mentioned a small side-pipeline I'd built for the modular hardware project: something that automatically renders schematic and board views on every push, so changes show up as pictures in the diff instead of requiring anyone to open the CAD tool just to look. I said I'd write it up properly, and it turned out to be a better example than I expected of how a one-line idea turns into a real engineering problem the moment it has to survive contact with an actively-changing repository.


Diagram of a four-step pipeline: push a board change, diff which board folders changed, render schematic/board/3D views for just those boards in a pinned container, commit the images back next to the source

Four steps. The second one is the one that needed a real second pass.


The friction it removes

Reviewing a hardware change is a different exercise than reviewing code. A diff of a board file is mostly noise — coordinates, net names, binary-ish blobs — it tells you almost nothing about whether a routing pass actually looks better or whether a part moved somewhere it shouldn't have. The only honest way to review it is to look at the board, which used to mean opening the CAD tool, finding the right project, and waiting for it to load — enough friction that it got skipped more often than it should have, especially on changes that felt "probably fine."

The fix is almost embarrassingly simple in concept: have something else open the CAD tool for you, every time, and leave the pictures where a reviewer is already looking.


What a render actually produces

On a push to the main branch that touches any board file, a Gitea Actions job runs a command-line export tool against each changed board and produces, per board: a schematic PDF, top and bottom SVGs of the actual copper/silkscreen/solder-mask layers, and top and bottom 3D-rendered images of the assembled board. Those land in a small


bash
hardware/<board>/out/render/

folder right next to the source files that produced them, and a bot identity commits them straight back into the same push's branch. No separate artifact store, no build log to dig through — the pictures are just files in the repository, versioned like everything else.


Pinning the tool was its own small lesson

The export step runs inside a container pinned to one specific, named version of the CAD tool, rather than whatever happens to be installed on the runner. That wasn't a stylistic choice — the first version I pointed it at simply didn't have the subcommand needed to produce the 3D renders at all; it had been added in a later release. Pinning the container image means the pipeline's behavior doesn't depend on what else is installed on that machine, and upgrading the tool later is a one-line version bump in the workflow file, not a round of reinstalling something on a shared runner that other jobs also depend on.


Only rendering what actually changed

The first working version did the simple thing: render every board, every time, regardless of what the push actually touched. That held up for exactly as long as the repository had one board in it. The moment there were several, every push — even one that touched a single board — churned the rendered images for all of them, which meant every diff was buried in unrelated image noise and the render step took several times longer than it needed to.

The real fix is a step that looks at exactly what changed between the previous commit and the new one, narrows that down to which board folders were actually touched, and renders only those:


bash
MODULES=$(git diff --name-only "$BEFORE..$SHA" -- hardware \
  | grep -E '\.(kicad_pro|kicad_sch|kicad_pcb)$' \
  | xargs -r -n1 dirname \
  | sort -u)

The part that actually took thought wasn't that line — it was deciding when not to trust it. A diff against the previous commit only means something if there is a previous commit the pipeline can actually reach: the very first push to a repository has no "before," and a force-push can rewrite history out from under that comparison entirely. In either case the fix falls back to rendering every board, same as the first version did. There's one more case worth an explicit fallback for too: if the pipeline definition itself changed, the output it's supposed to produce might have changed along with it, so that push also renders everything rather than quietly trusting a diff against logic that may no longer match what the render step now does.

Verified it the straightforward way: pushed a change that only touched one board, and watched only that board's images update in the resulting commit, with every other board's left untouched.


A tradeoff that only shows up on a fast-moving repository

One setting turned out to matter more than expected: the pipeline is configured to cancel an in-progress run the moment a newer push arrives on the same branch, rather than letting it finish. That's the right call here — this project gets pushed to every few minutes while a board is actively being worked on, and finishing a render for a commit that's already three commits stale by the time it completes is wasted compute for images nobody's going to look at anyway.

The tradeoff is that watching one specific run through to a result stopped being reliable while active editing was happening — it kept getting cancelled by whatever got pushed next before it finished. Not a bug, just a genuine consequence of optimizing for "keep up with a fast-moving repo" over "guarantee every single push gets its own completed run." The practical fix was just patience: wait for pushes to settle for a minute before expecting to see a finished result.


The small version of the same lesson

This pipeline ended up being a miniature version of the exact same pattern from the last post: a one-line idea ("just render it automatically") turning into a real design problem the moment it had to survive first pushes, force-pushes, a changing pipeline definition, and a repository that doesn't sit still. None of those are exotic failure modes — they're the ordinary edge cases any automation eventually meets — but each one only became obvious by asking "what happens when..." rather than shipping the version that worked on the first try and calling it done.