Improve golang CI
This commit is contained in:
parent
8145690bfd
commit
fee9ec19fd
5 changed files with 46 additions and 29 deletions
53
.github/workflows/go.yml
vendored
53
.github/workflows/go.yml
vendored
|
|
@ -7,32 +7,45 @@ on:
|
|||
branches: [ main ]
|
||||
|
||||
jobs:
|
||||
|
||||
test:
|
||||
name: Test
|
||||
name: Test with latest golang
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Check out repo
|
||||
uses: actions/checkout@v3
|
||||
|
||||
- name: Set up Go 1.x
|
||||
uses: actions/setup-go@v2
|
||||
- name: Set up latest golang
|
||||
uses: actions/setup-go@v3
|
||||
with:
|
||||
go-version: ^1.18
|
||||
|
||||
- name: Test
|
||||
run: go test -v -race ./...
|
||||
|
||||
test-old:
|
||||
name: Test with 1.15
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Check out repo
|
||||
uses: actions/checkout@v3
|
||||
|
||||
- name: Set up Go 1.15
|
||||
uses: actions/setup-go@v3
|
||||
with:
|
||||
go-version: ^1.16
|
||||
id: go
|
||||
|
||||
- name: Check out code into the Go module directory
|
||||
uses: actions/checkout@v2
|
||||
|
||||
- name: Get dependencies
|
||||
run: |
|
||||
go get -v -t -d ./...
|
||||
if [ -f Gopkg.toml ]; then
|
||||
curl https://raw.githubusercontent.com/golang/dep/master/install.sh | sh
|
||||
dep ensure
|
||||
fi
|
||||
go install github.com/golangci/golangci-lint/cmd/golangci-lint@latest
|
||||
go-version: 1.15
|
||||
|
||||
- name: Test
|
||||
run: go test -v -race ./...
|
||||
|
||||
- name: Lint
|
||||
run: golangci-lint run ./...
|
||||
lint:
|
||||
name: Lint
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/setup-go@v3
|
||||
with:
|
||||
go-version: 1.17
|
||||
- uses: actions/checkout@v3
|
||||
- name: golangci-lint
|
||||
uses: golangci/golangci-lint-action@v3
|
||||
with:
|
||||
version: v1.46.2
|
||||
Loading…
Add table
Add a link
Reference in a new issue