-
Notifications
You must be signed in to change notification settings - Fork 0
36 lines (31 loc) · 1.02 KB
/
test.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
36
name: "Tests"
on:
workflow_call:
defaults:
run:
shell: bash
jobs:
go-test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-go@v4
with:
go-version-file: ./go.mod
cache: true
- name: test
run: |
go test -race -ldflags "-X google.golang.org/protobuf/reflect/protoregistry.conflictPolicy=warn" -timeout=60s -covermode=atomic -coverprofile=$GITHUB_WORKSPACE/profile.cov_tmp ./...
cat $GITHUB_WORKSPACE/profile.cov_tmp | grep -v "_mock.go" > $GITHUB_WORKSPACE/profile.cov
working-directory: .
env:
GOFLAGS: "-mod=vendor"
TZ: "America/New_York"
- name: install goveralls
run: |
GO111MODULE=off go get -u github.com/mattn/goveralls
- name: submit coverage
run: $(go env GOPATH)/bin/goveralls -service="github" -coverprofile=$GITHUB_WORKSPACE/profile.cov
working-directory: .
env:
COVERALLS_TOKEN: ${{ secrets.GITHUB_TOKEN }}