‹ BackHN Continuity

Thread

Scaling Golang CI by Replacing actions/setup-go

77 points · 26 comments · peterldowns

  1. vbernat · · focus · HN ↗
    I am setting cache to `false` and directly use actions/cache:

        - 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.
Open on Hacker News to reply ↗

Unofficial Hacker News client; not affiliated with Y Combinator.