From 0bc9732e62ac6aa54cbb43560e704c0729408cc7 Mon Sep 17 00:00:00 2001 From: Colin Adler Date: Wed, 2 Aug 2023 03:17:45 +0000 Subject: [PATCH 1/2] chore: increment `GOCACHE` key It seems like this just boundlessly grows. Right now it's `~3535 MB (3707029742 B)`. Another alternative is to just remove this entirely since I really doubt this helps much, but this seems to be the easiest for now. --- .github/actions/setup-go/action.yaml | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/.github/actions/setup-go/action.yaml b/.github/actions/setup-go/action.yaml index 29b7061e85975..7661070b8df81 100644 --- a/.github/actions/setup-go/action.yaml +++ b/.github/actions/setup-go/action.yaml @@ -48,15 +48,16 @@ runs: with: path: | ${{ env.GOCACHE }} - # Job name must be included in the key for effective - # test cache reuse. + # Job name must be included in the key for effective test cache reuse. # The key format is intentionally different than GOMODCACHE, because any - # time a Go file changes we invalidate this cache, whereas GOMODCACHE - # is only invalidated when go.sum changes. - key: gocache-${{ runner.os }}-${{ github.job }}-${{ hashFiles('**/*.go', 'go.**') }} + # time a Go file changes we invalidate this cache, whereas GOMODCACHE is + # only invalidated when go.sum changes. + # The number in the key is incremented when the cache gets too large, + # since this technically grows without bound. + key: gocache2-${{ runner.os }}-${{ github.job }}-${{ hashFiles('**/*.go', 'go.**') }} restore-keys: | - gocache-${{ runner.os }}-${{ github.job }}- - gocache-${{ runner.os }}- + gocache2-${{ runner.os }}-${{ github.job }}- + gocache2-${{ runner.os }}- - name: Install gotestsum shell: bash From 216f5dd76049a583a4647d04643a2b4016eab32f Mon Sep 17 00:00:00 2001 From: Colin Adler Date: Wed, 2 Aug 2023 03:25:21 +0000 Subject: [PATCH 2/2] fixup! chore: increment `GOCACHE` key --- .github/actions/setup-go/action.yaml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/actions/setup-go/action.yaml b/.github/actions/setup-go/action.yaml index 7661070b8df81..4d696ef298b12 100644 --- a/.github/actions/setup-go/action.yaml +++ b/.github/actions/setup-go/action.yaml @@ -39,9 +39,9 @@ runs: path: | ${{ env.GOMODCACHE }} key: gomodcache-${{ runner.os }}-${{ hashFiles('**/go.sum') }}-${{ github.job }} - restore-keys: | - gomodcache-${{ runner.os }}-${{ hashFiles('**/go.sum') }}- - gomodcache-${{ runner.os }}- + # restore-keys aren't used because it causes the cache to grow + # infinitely. go.sum changes very infrequently, so rebuilding from + # scratch every now and then isn't terrible. - name: Cache $GOCACHE uses: buildjet/cache@v3