-
Notifications
You must be signed in to change notification settings - Fork 3
60 lines (52 loc) · 1.37 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
54
55
56
57
58
59
60
name: Test and coverage
on:
push:
branches:
- 'main'
pull_request:
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout current branch
uses: actions/checkout@v2
- name: Setup Golang
uses: actions/setup-go@v2
with:
go-version: '1.18'
- name: Load cached dependencies
uses: actions/cache@v3
with:
path: |
~/.cache/go-build
~/go/pkg/mod
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
restore-keys: |
${{ runner.os }}-go-
- name: Download Dependencies
run: |
go mod download
(cd cmd && go mod download)
(cd benchmarks && go mod download)
- name: Run coverage
run: |
make cover
(cd cmd && make cover)
- name: Upload lib coverage to Codecov
uses: codecov/codecov-action@v3
with:
token: ${{secrets.CODECOV_TOKEN}}
files: ./cover.out
flags: lib
name: lib
fail_ci_if_error: true
verbose: true
- name: Upload cmd coverage to Codecov
uses: codecov/codecov-action@v3
with:
token: ${{secrets.CODECOV_TOKEN}}
files: ./cmd/cover.out
flags: cmd
name: cmd
fail_ci_if_error: true
verbose: true