@@ -8,57 +8,11 @@ inputs:
8
8
runs :
9
9
using :" composite"
10
10
steps :
11
- -name :Cache go toolchain
12
- uses :buildjet/cache@v3
13
- with :
14
- path :|
15
- ${{ runner.tool_cache }}/go/${{ inputs.version }}
16
- key :gotoolchain-${{ runner.os }}-${{ inputs.version }}
17
- restore-keys :|
18
- gotoolchain-${{ runner.os }}-
19
-
20
11
-name :Setup Go
21
12
uses :buildjet/setup-go@v4
22
13
with :
23
- # We do our own caching for implementation clarity.
24
- cache :false
25
14
go-version :${{ inputs.version }}
26
15
27
- -name :Get cache dirs
28
- shell :bash
29
- run :|
30
- set -x
31
- echo "GOMODCACHE=$(go env GOMODCACHE)" >> $GITHUB_ENV
32
- echo "GOCACHE=$(go env GOCACHE)" >> $GITHUB_ENV
33
-
34
- # We split up GOMODCACHE from GOCACHE because the latter must be invalidated
35
- # on code change, but the former can be kept.
36
- -name :Cache $GOMODCACHE
37
- uses :buildjet/cache@v3
38
- with :
39
- path :|
40
- ${{ env.GOMODCACHE }}
41
- key :gomodcache-${{ runner.os }}-${{ hashFiles('**/go.sum') }}-${{ github.job }}
42
- # restore-keys aren't used because it causes the cache to grow
43
- # infinitely. go.sum changes very infrequently, so rebuilding from
44
- # scratch every now and then isn't terrible.
45
-
46
- -name :Cache $GOCACHE
47
- uses :buildjet/cache@v3
48
- with :
49
- path :|
50
- ${{ env.GOCACHE }}
51
- # Job name must be included in the key for effective test cache reuse.
52
- # The key format is intentionally different than GOMODCACHE, because any
53
- # time a Go file changes we invalidate this cache, whereas GOMODCACHE is
54
- # only invalidated when go.sum changes.
55
- # The number in the key is incremented when the cache gets too large,
56
- # since this technically grows without bound.
57
- key :gocache2-${{ runner.os }}-${{ github.job }}-${{ hashFiles('**/*.go', 'go.**') }}
58
- restore-keys :|
59
- gocache2-${{ runner.os }}-${{ github.job }}-
60
- gocache2-${{ runner.os }}-
61
-
62
16
-name :Install gotestsum
63
17
shell :bash
64
18
run :go install gotest.tools/gotestsum@latest