Report test coverage in GitHub workflow

This commit is contained in:
Christian Muehlhaeuser 2020-01-08 22:00:11 +01:00
commit 225f822a36
No known key found for this signature in database
GPG key ID: 3CF9FA45CA1EBB7E

View file

@ -7,6 +7,8 @@ jobs:
go-version: [1.11.x, 1.12.x, 1.13.x]
platform: [ubuntu-latest, macos-latest, windows-latest]
runs-on: ${{ matrix.platform }}
env:
GO111MODULE: "on"
steps:
- name: Install Go
@ -18,16 +20,19 @@ jobs:
uses: actions/checkout@v1
- name: Download Go modules
env:
GO111MODULE: "on"
run: go mod download
- name: Build
env:
GO111MODULE: "on"
run: go build -v ./...
- name: Test
env:
GO111MODULE: "on"
run: go test ./...
- name: Coverage
env:
COVERALLS_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
go test -race -covermode atomic -coverprofile=profile.cov ./...
GO111MODULE=off go get github.com/mattn/goveralls
$(go env GOPATH)/bin/goveralls -coverprofile=profile.cov -service=github
if: matrix.go-version == '1.13.x' && matrix.platform == 'ubuntu-latest'