Hacker News front pageLukas Schwab, Peter Downs9 min readintermediate
Scaling Golang CI by Replacing actions/setup-go
Summary
The default GitHub actions/setup-go action degrades parallel Go CI performance due to incomplete cache keys and stale writes. A new open-source action, cloudx-io/setup-go, resolves this with job-specific and run-ID-based keys, cutting test job runtimes by 69%.
- actions/setup-go's broad cache key causes stale caches and unnecessary re-runs in parallel Go CI jobs.
- Parallel jobs using actions/setup-go race to write incomplete cache states, slowing subsequent jobs.
- Go's module, build, and test caches are highly optimized for persistent filesystems, using complete, minimal dependency keys.
- cloudx-io/setup-go uses job identity and run ID in its cache key to ensure unique, fresh cache writes for each job.
Engineers managing moderately complex Go projects with parallel CI jobs can significantly reduce their CI runtimes and improve developer feedback loops by adopting this optimized caching strategy.
7/10



