6
6
- main
7
7
pull_request :
8
8
9
+ env :
10
+ GO_VERSION : 1.18
11
+
9
12
jobs :
10
13
lint :
11
14
name : Lint
12
15
runs-on : ubuntu-latest
13
- env :
14
- GO111MODULE : " on"
15
16
steps :
16
- - name : Set up Go 1.16
17
- uses : actions/setup-go@v2
18
- with :
19
- go-version : 1.16
20
- id : go
21
-
22
17
- name : Checkout code into the Go module directory
23
- uses : actions/checkout@v2
18
+ uses : actions/checkout@v3
19
+
20
+ - name : Set up Go
21
+ uses : actions/setup-go@v3
22
+ with :
23
+ go-version : ${{ env.GO_VERSION }}
24
+ cache : true
24
25
25
26
- name : Validate go-mod is up-to-date and license headers
26
27
run : make validate
@@ -29,30 +30,23 @@ jobs:
29
30
env :
30
31
BUILD_TAGS : kube,e2e
31
32
run : |
32
- curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sudo sh -s -- -b /usr/bin/ v1.39.0
33
+ curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sudo sh -s -- -b /usr/bin/ v1.45.2
33
34
make -f builder.Makefile lint
34
35
35
36
# only on main branch, costs too much for the gain on every PR
36
37
validate-cross-build :
37
38
name : Validate cross build
38
39
runs-on : ubuntu-latest
39
40
if : github.ref == 'refs/heads/main'
40
- env :
41
- GO111MODULE : " on"
42
41
steps :
43
- - name : Set up Go 1.16
44
- uses : actions/setup-go@v2
45
- with :
46
- go-version : 1.16
47
- id : go
48
-
49
42
- name : Checkout code into the Go module directory
50
- uses : actions/checkout@v2
43
+ uses : actions/checkout@v3
51
44
52
- - uses : actions/cache@v2
45
+ - name : Set up Go
46
+ uses : actions/setup-go@v3
53
47
with :
54
- path : ~/go/pkg/mod
55
- key : go-${{ hashFiles('**/go.sum') }}
48
+ go-version : ${{ env.GO_VERSION }}
49
+ cache : true
56
50
57
51
# Ensure we don't discover cross platform build issues at release time.
58
52
# Time used to build linux here is gained back in the build for local E2E step
@@ -62,32 +56,25 @@ jobs:
62
56
build :
63
57
name : Build
64
58
runs-on : ubuntu-latest
65
- env :
66
- GO111MODULE : " on"
67
59
steps :
68
- - name : Set up Go 1.16
69
- uses : actions/setup-go@v2
60
+ - name : Checkout code into the Go module directory
61
+ uses : actions/checkout@v3
62
+
63
+ - name : Set up Go
64
+ uses : actions/setup-go@v3
70
65
with :
71
- go-version : 1.16
72
- id : go
66
+ go-version : ${{ env.GO_VERSION }}
67
+ cache : true
73
68
74
69
- name : Set up gosum
75
70
run : |
76
- go get -u gotest.tools/gotestsum
71
+ go install gotest.tools/gotestsum@latest
77
72
78
73
- name : Setup docker CLI
79
74
run : |
80
75
curl https://download.docker.com/linux/static/stable/x86_64/docker-20.10.3.tgz | tar xz
81
76
sudo cp ./docker/docker /usr/bin/ && rm -rf docker && docker version
82
77
83
- - name : Checkout code into the Go module directory
84
- uses : actions/checkout@v2
85
-
86
- - uses : actions/cache@v2
87
- with :
88
- path : ~/go/pkg/mod
89
- key : go-${{ hashFiles('**/go.sum') }}
90
-
91
78
- name : Test
92
79
env :
93
80
BUILD_TAGS : kube
0 commit comments