-
Notifications
You must be signed in to change notification settings - Fork 30
35 lines (35 loc) · 1.07 KB
/
coverage.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
name: Code Coverage
on: [push, pull_request]
jobs:
test:
env:
GOPATH: ${{ github.workspace }}
defaults:
run:
working-directory: ${{ env.GOPATH }}/src/github.com/${{ github.repository }}
name: Post
runs-on: ubuntu-latest
steps:
- name: Set up Go
uses: actions/setup-go@v2
with:
go-version: '1.22.0'
- name: Check out code
uses: actions/checkout@v2
with:
path: ${{ env.GOPATH }}/src/github.com/${{ github.repository }}
- name: Install dependencies
run: |
go mod download
- name: Run Unit tests
run: |
go test $(go list ./... | grep -v /vendor/ | grep -v /cmd | grep -v /tests) -race -covermode atomic -coverprofile=covprofile ./...
- name: Install goveralls
env:
GOPATH: ${{ github.workspace }}
run: go install github.com/mattn/goveralls@latest
- name: Send coverage
run: $GOPATH/bin/goveralls -coverprofile=covprofile -service=github
env:
COVERALLS_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GOPATH: ${{ github.workspace }}