8
8
branches :
9
9
- ' main'
10
10
11
+ env :
12
+ GO_VERSION : ' 1.23'
13
+
11
14
jobs :
12
15
check-go :
13
16
name : Check Go code
18
21
- name : Setup Golang
19
22
uses : actions/setup-go@v5
20
23
with :
21
- go-version : ' 1.22.4'
22
- - name : Download all Go modules
23
- run : |
24
- go mod download
24
+ go-version : ${{ env.GO_VERSION }}
25
+ cache : true
25
26
- name : Check for tidyness of go.mod and go.sum
26
27
run : |
27
28
go mod tidy
@@ -34,17 +35,10 @@ jobs:
34
35
- name : Checkout code
35
36
uses : actions/checkout@v4
36
37
- name : Setup Golang
37
- uses : actions/setup-go@v1
38
- with :
39
- go-version : ' 1.21'
40
- - name : Restore go build cache
41
- uses : actions/cache@v1
38
+ uses : actions/setup-go@v5
42
39
with :
43
- path : ~/.cache/go-build
44
- key : ${{ runner.os }}-go-build-v1-${{ github.run_id }}
45
- - name : Download all Go modules
46
- run : |
47
- go mod download
40
+ go-version : ${{ env.GO_VERSION }}
41
+ cache : true
48
42
49
43
lint-go :
50
44
name : Lint Go code
53
47
- name : Checkout code
54
48
uses : actions/checkout@v4
55
49
- name : Run golangci-lint
56
- uses : golangci/golangci-lint-action@v3
50
+ uses : golangci/golangci-lint-action@v4
57
51
with :
58
52
args : --timeout 5m
59
53
@@ -66,27 +60,18 @@ jobs:
66
60
- name : Create checkout directory
67
61
run : mkdir -p ~/go/src/github.com/gitpod-io
68
62
- name : Checkout code
69
- uses : actions/checkout@v4
70
- with :
71
- fetch-depth : 10
63
+ uses : actions/checkout@v5
72
64
- name : Create symlink in GOPATH
73
65
run : ln -s $(pwd) ~/go/src/github.com/gitpod-io/leeway
74
66
- name : Setup Golang
75
- uses : actions/setup-go@v1
76
- with :
77
- go-version : ' 1.21'
78
- - name : Restore go build cache
79
- uses : actions/cache@v1
67
+ uses : actions/setup-go@v5
80
68
with :
81
- path : ~/.cache/go-build
82
- key : ${{ runner.os }}-go-build-v1-${{ github.run_id }}
83
- - name : Download and vendor all required packages
84
- run : |
85
- go mod download
69
+ go-version : ${{ env.GO_VERSION }}
70
+ cache : true
86
71
- name : Run all unit tests
87
72
run : go test -v -coverprofile=coverage.out $(go list ./...)
88
73
- name : Generate code coverage artifacts
89
- uses : actions/upload-artifact@v2
74
+ uses : actions/upload-artifact@v4
90
75
with :
91
76
name : code-coverage
92
77
path : coverage.out
@@ -101,22 +86,13 @@ jobs:
101
86
run : mkdir -p ~/go/src/github.com/gitpod-io
102
87
- name : Checkout code
103
88
uses : actions/checkout@v4
104
- with :
105
- fetch-depth : 10
106
89
- name : Create symlink in GOPATH
107
90
run : ln -s $(pwd) ~/go/src/github.com/gitpod-io/leeway
108
91
- name : Setup Golang
109
- uses : actions/setup-go@v1
110
- with :
111
- go-version : ' 1.21'
112
- - name : Restore go build cache
113
- uses : actions/cache@v1
92
+ uses : actions/setup-go@v5
114
93
with :
115
- path : ~/.cache/go-build
116
- key : ${{ runner.os }}-go-build-v1-${{ github.run_id }}
117
- - name : Download and vendor all required packages
118
- run : |
119
- go mod download
94
+ go-version : ${{ env.GO_VERSION }}
95
+ cache : true
120
96
- name : Run all unit tests
121
97
run : go test -race -v $(go list ./...)
122
98
@@ -134,10 +110,10 @@ jobs:
134
110
run : |
135
111
mkdir -p test-results
136
112
- name : Get code coverage artifiact
137
- uses : actions/download-artifact@v2
113
+ uses : actions/download-artifact@v4
138
114
with :
139
115
name : code-coverage
140
116
- name : Upload code coverage information to codecov.io
141
- uses : codecov/codecov-action@v1
117
+ uses : codecov/codecov-action@v4
142
118
with :
143
119
file : coverage.out
0 commit comments