‹ BackHN Continuity

Thread

Scaling Golang CI by Replacing actions/setup-go

77 points · 26 comments · peterldowns

  1. peterldowns · · focus · HN ↗
    Hey everyone, one of the authors here. This is a "small" improvement that has saved us a LOT of developer time over the last few months. It's actually quite crazy to me that the default actions/setup-go simply does not work well if you want to have more than one golang action running at the same time.

    The blogpost has a lot of technical details, but you can also just read the code and try it yourself:

    <a href="https:&#x2F;&#x2F;github.com&#x2F;cloudx-io&#x2F;setup-go" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;cloudx-io&#x2F;setup-go

    1. bewuethr · · focus · HN ↗
      We recently did similar work for our pipelines, heavily based on Better GitHub Actions caching for Go [0]. Were you aware of that article, or did you (re-)discover things like the cache trimming?

      What&#x27;s the best way to contribute? I&#x27;d like to expose the &quot;go-version-file&quot; input for the setup-go action instead of setting a Go version directly. Open an issue in the repo?

      Also, have you considered this potential optimization: the module cache doesn&#x27;t care about architecture, it&#x27;s just downloaded code. Would it make sense to cache module and build cache separately, and use an architecture-free cache key for the module cache?

      [0]: <a href="https:&#x2F;&#x2F;danp.net&#x2F;posts&#x2F;github-actions-go-cache&#x2F;" rel="nofollow">https:&#x2F;&#x2F;danp.net&#x2F;posts&#x2F;github-actions-go-cache&#x2F;

      1. peterldowns · · focus · HN ↗
        We hadn&#x27;t seen that post before --- very similar, but completely independent.

        Reasonable suggestions, but we&#x27;ve mostly published our action as reference for others. I&#x27;d suggest forking or creating your own setup-go action and implementing whatever behavior you&#x27;d like. Nothing wrong with either idea!

Open on Hacker News to reply ↗

Unofficial Hacker News client; not affiliated with Y Combinator.