Add coveralls.io code coverage github-action
This uses the goveralls package to convert the coverage report to lcov and send it to coveralls.io
This commit is contained in:
parent
46c3bed153
commit
c5341211e9
1 changed files with 35 additions and 0 deletions
35
.github/workflows/coverage.yml
vendored
Normal file
35
.github/workflows/coverage.yml
vendored
Normal file
|
|
@ -0,0 +1,35 @@
|
|||
name: Coverage
|
||||
|
||||
# NOTE(mhayden): Restricting branches prevents jobs from being doubled since
|
||||
# a push to a pull request triggers two events.
|
||||
on:
|
||||
pull_request:
|
||||
branches:
|
||||
- "*"
|
||||
push:
|
||||
branches:
|
||||
- master
|
||||
|
||||
jobs:
|
||||
test:
|
||||
name: Test with Coverage
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Set up Go
|
||||
uses: actions/setup-go@v1
|
||||
with:
|
||||
go-version: '1.13'
|
||||
- name: Check out code
|
||||
uses: actions/checkout@v2
|
||||
- name: Install dependencies
|
||||
run: |
|
||||
go mod download
|
||||
- name: Run Unit tests
|
||||
run: |
|
||||
go test -race -covermode atomic -coverprofile=profile.cov ./...
|
||||
- name: Send coverage
|
||||
env:
|
||||
COVERALLS_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
run: |
|
||||
GO111MODULE=off go get github.com/mattn/goveralls
|
||||
$(go env GOPATH)/bin/goveralls -coverprofile=profile.cov -service=github
|
||||
Loading…
Add table
Add a link
Reference in a new issue