Scaling Golang CI by Replacing actions/setup-go

(cloudx.ai)

38 points | by peterldowns 2 hours ago

2 comments

  • JyB 32 minutes ago
    Have you considered submitting an upstream patch to the widely used actions/setup-go as well?
    • peterldowns 16 minutes ago
      Good question — we'd be happy to submit a PR, but it's not clear to me that they'd be interested. Some background:

      - Our approach writes new cache entries all the time. This can get expensive, and is a pretty big change in behavior from how actions/setup-go works today.

      - The current actions/setup-go strictly caches dependencies and ignores the build and modules cache. Our approach could be considered a breaking change.

      - actions/setup-go can basically be considered incredibly critical infrastructure for the public golang ecosystem. Any change in behavior is probably very risky and slow to happen. At this point I'd bet that we see no change, ever, in behavior.

      Additionally there are a few relevant issues/prs that have been ignored for years so I'm not optimistic about contributing upstream. Frankly what we've done is write a very small bit of glue code that is likely most effective as a reference for teams writing their own custom caching actions that fit their exact needs:

      - https://github.com/actions/setup-go/pull/426

      - https://github.com/actions/setup-go/issues/630

      - https://github.com/actions/setup-go/issues/395

      - https://github.com/actions/setup-go/issues/596

      That said we'd be happy if someone used our code and found it valuable! Lukas put a ton of effort into cleaning up my initial version, added the cache trimming, etc. We depend on this for all of our jobs and use it every day and think it's quite good.

  • peterldowns 2 hours ago
    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:

    https://github.com/cloudx-io/setup-go