...
1on: [push, pull_request]
2name: test
3jobs:
4 test:
5 strategy:
6 fail-fast: false
7 matrix:
8 go-version: [1.19.x, 1.20.x]
9 platform: [ubuntu-latest, macos-latest, windows-latest]
10 runs-on: ${{ matrix.platform }}
11 steps:
12 - name: Install Go
13 uses: actions/setup-go@v4
14 with:
15 go-version: ${{ matrix.go-version }}
16 - name: Checkout code
17 uses: actions/checkout@v3
18 - name: Run lints
19 uses: golangci/golangci-lint-action@v3
20 with:
21 version: latest
22 if: "matrix.platform == 'ubuntu-latest'" # gofmt linter fails on Windows for CRLF problems
23 - name: Run tests
24 run: go test -v ./... -covermode=count -coverprofile=coverage.out -coverpkg=./...
25 - name: Send coverage
26 if: "matrix.platform == 'ubuntu-latest'"
27 env:
28 COVERALLS_TOKEN: ${{ secrets.GITHUB_TOKEN }}
29 run: |
30 GO111MODULE=off go get github.com/mattn/goveralls
31 $(go env GOPATH)/bin/goveralls -coverprofile=coverage.out -service=github
View as plain text