Update go 1.21 and linter #25
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: CI | |
on: [push] | |
jobs: | |
test-library: | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
go-version: [ '1.19', '1.20', '1.21', '1.22.x' ] | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Setup Go | |
uses: actions/setup-go@v4 | |
with: | |
go-version: ${{ matrix.go-version }} | |
- name: Install dependencies | |
run: go get . | |
- name: Go formatting analysis | |
run: | | |
if [ -n "$(gofmt -l .)" ]; then | |
gofmt -d . | |
exit 1 | |
fi | |
- name: Go code quality analysis | |
run: go vet ./... | |
- name: Go unit testing | |
run: | | |
go test -race $(go list ./... | grep -v /vendor/) -v -coverprofile=coverage.out | |
go tool cover -func=coverage.out | |
- name: Upload coverage results | |
uses: actions/upload-artifact@v3 | |
with: | |
name: coverage | |
path: coverage.out | |
test-lint: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Setup Go | |
uses: actions/setup-go@v4 | |
with: | |
go-version: ${{ matrix.go-version }} | |
- name: Install golangci-lint | |
run: | | |
curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s v1.57.2 | |
- name: Run golangci-lint | |
run: ./bin/golangci-lint run -v |