Skip to content

Commit 444fa8c

Browse files
robshakirwenovus
andauthored
Specify latest release of staticcheck rather than HEAD. (#624)
* Specify latest release of staticcheck rather than HEAD. * Move to go modules mode. * Remove -u flag. * Can't use `go install` outside of a module. * Attempt to fix workflow * Attempt to fix workflow * Attempt to fix workflow * Attempt to fix workflow * Remove useless GO111MODULE Co-authored-by: wenovus <[email protected]>
1 parent 6cdb0cb commit 444fa8c

File tree

1 file changed

+14
-12
lines changed

1 file changed

+14
-12
lines changed

.github/workflows/go.yml

Lines changed: 14 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -28,17 +28,19 @@ jobs:
2828
go-version: ${{ matrix.go }}
2929
id: go
3030

31-
- name: Install protoc-gen-go
31+
- if: ${{ matrix.go == '1.13' || matrix.go == '1.14' || matrix.go == '1.15' }}
32+
name: Install protoc-gen-go, goimports, Staticcheck
3233
run: |
33-
go get -u google.golang.org/protobuf/cmd/protoc-gen-go
34+
GO111MODULE=on go get google.golang.org/protobuf/cmd/protoc-gen-go@latest
35+
GO111MODULE=on go get golang.org/x/tools/cmd/goimports@latest
36+
GO111MODULE=on go get honnef.co/go/tools/cmd/staticcheck@latest
3437
35-
- name: Install goimports
38+
- if: ${{ !(matrix.go == '1.13' || matrix.go == '1.14' || matrix.go == '1.15') }}
39+
name: Install protoc-gen-go, goimports, Staticcheck
3640
run: |
37-
go get -u golang.org/x/tools/cmd/goimports
38-
39-
- name: Install Staticcheck
40-
run: |
41-
go get -u honnef.co/go/tools/cmd/staticcheck
41+
go install google.golang.org/protobuf/cmd/protoc-gen-go@latest
42+
go install golang.org/x/tools/cmd/goimports@latest
43+
go install honnef.co/go/tools/cmd/staticcheck@latest
4244
4345
- name: Check out code
4446
uses: actions/checkout@v2
@@ -126,14 +128,14 @@ jobs:
126128
- name: Install Go
127129
uses: actions/setup-go@v2
128130
with:
129-
go-version: '1.15'
131+
go-version: '1.x'
130132
id: go
131133

132134
- name: Install required static analysis tools
133135
run: |
134-
go get -u github.com/go-playground/overalls
135-
go get -u github.com/mattn/goveralls
136-
go get -u honnef.co/go/tools/cmd/staticcheck
136+
go install github.com/go-playground/overalls@latest
137+
go install github.com/mattn/goveralls@latest
138+
go install honnef.co/go/tools/cmd/staticcheck@latest
137139
138140
- name: Check out ygot code
139141
uses: actions/checkout@v2

0 commit comments

Comments
 (0)