74 points by peterldowns 4 days ago | 25 comments | View on ycombinator
wannabe44 4 days ago |
peterldowns 4 days ago |
The blogpost has a lot of technical details, but you can also just read the code and try it yourself:
JyB 4 days ago |
vbernat 3 days ago |
- uses: actions/cache@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6
if: ${{ inputs.setup-go == 'true' }}
with:
path: |
${{ env.gocache }}
${{ env.gomodcache }}
key: ${{ runner.os }}-${{ runner.arch }}-go${{ steps.go-setup.outputs.go-version }}-${{ hashFiles('go.sum') }}-${{ env.today }}
restore-keys: |
${{ runner.os }}-${{ runner.arch }}-go${{ steps.go-setup.outputs.go-version }}-${{ hashFiles('go.sum') }}-
${{ runner.os }}-${{ runner.arch }}-go${{ steps.go-setup.outputs.go-version }}-
You get one new cache every day, and you can still load the most recent one if you are the first run today.lukasschwab 4 days ago |
It only gets a brief mention, but the cache-pruning change was an interesting one. Cache accretion happens in the default actions/setup-go too, but dramatically increasing the number of cache-writes for cloudx-io/setup-go made it an actual issue.
As the cache grows, so does the time it takes to load it from GitHub's actions cache... and that grows until it's a significant time-suck in CI. We prune with basic mark-and-sweep.
Digging deeper, the pluggable `GOCACHEPROG` (introduced in Go 1.24) is a really useful tool. Shimming the normal cache logic for measurement, for example. In theory this should also be attractive for remote caching.
tonymet 4 days ago |
I’ve long wondered why setup-go was so slow and expensive it’s great to see improvements made.
y0ssar1an 4 days ago |
camdenclark 3 days ago |
colek42 3 days ago |
However, other people around me are fine with apt installs and pip installs from global mirrors in every CI run. So I may be just autistic.