Update go version and linting.

This commit is contained in:
bvanvugt 2023-02-19 17:12:03 +00:00
parent 1940f03d40
commit a1bf6ec0ff
4 changed files with 29 additions and 25 deletions

View file

@ -3,7 +3,7 @@ name: Test
on: [push, pull_request]
env:
GO_VERSION: 1.18.1
GO_VERSION: 1.20
jobs:
@ -15,6 +15,7 @@ jobs:
- uses: actions/setup-go@main
with:
go-version: '${{ env.GO_VERSION }}'
check-latest: true
- name: Run gofmt
run: test -z $(gofmt -l .) || (gofmt -d . && exit 1)
@ -27,9 +28,10 @@ jobs:
- uses: actions/setup-go@main
with:
go-version: '${{ env.GO_VERSION }}'
check-latest: true
- name: Run golangci-lint
run: |
curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $(go env GOPATH)/bin v1.45.2
curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $(go env GOPATH)/bin v1.51.1
golangci-lint run -v ./...
test:
@ -41,6 +43,7 @@ jobs:
- uses: actions/setup-go@main
with:
go-version: '${{ env.GO_VERSION }}'
check-latest: true
- name: Run go test
run: go test -race ./...
@ -53,6 +56,7 @@ jobs:
- uses: actions/setup-go@main
with:
go-version: '${{ env.GO_VERSION }}'
check-latest: true
- name: Run go build
run: |
go build ./cli/battlesnake