-
Notifications
You must be signed in to change notification settings - Fork 113
53 lines (53 loc) · 1.65 KB
/
codecov.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
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
name: codecov
on:
push:
branches:
- main
pull_request:
branches:
- main
permissions:
contents: read
# Optional: allow read access to pull request. Use with `only-new-issues` option.
# pull-requests: read-
jobs:
codecov:
strategy:
matrix:
go: [ 1.19 ]
os: [ ubuntu-latest ]
name: codecov
if: |
startsWith(github.event.pull_request.title, 'fix') ||
startsWith(github.event.pull_request.title, 'feat') ||
startsWith(github.event.pull_request.title, 'refactor') ||
startsWith(github.event.pull_request.title, 'perf') ||
startsWith(github.event.pull_request.title, 'test')
runs-on: ${{ matrix.os }}
steps:
- uses: actions/setup-go@v3
with:
go-version: ${{ matrix.go }}
check-latest: true
- name: checkout-vanus
uses: actions/checkout@v3
- name: Generate coverage report
timeout-minutes: 5
run: |
for pkg in lib api pkg client server; do
for d in $(go list ./$pkg/... | grep -v /pkg/raft); do
go test -failfast -race -coverprofile=profile.out -covermode=atomic -timeout 300s $d
if [ -f profile.out ]; then
cat profile.out >> coverage.txt
rm profile.out
fi
done
done
- uses: codecov/codecov-action@v3
with:
token: ${{ secrets.CODECOV_TOKEN }}
files: ./coverage.txt # optional
flags: unittests # optional
name: codecov-umbrella # optional
fail_ci_if_error: true # optional (default = false)
verbose: true # optional (default = false)