-
Notifications
You must be signed in to change notification settings - Fork 0
48 lines (48 loc) · 1.19 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
36
37
38
39
40
41
42
43
44
45
46
47
48
name: Coverage
on:
push:
paths:
- .github/workflows/coverage.yml
- "**.go"
- go.sum
- go.mod
- codecov.yml
pull_request:
paths:
- .github/workflows/coverage.yml
- "**.go"
- go.sum
- go.mod
- codecov.yml
workflow_dispatch:
branches: ["*"]
env:
GO_VERSION: 1.17
jobs:
converage:
name: Coverage
runs-on: ubuntu-18.04
timeout-minutes: 2
steps:
- name: Set up Go
uses: actions/setup-go@v2
with:
go-version: ${{ env.GO_VERSION }}
- name: Check out code into the Go module directory
uses: actions/checkout@v2
- name: Cache
uses: actions/cache@v2
with:
path: ~/go/pkg/mod
key: ${{ runner.os }}-go-${{ env.GO_VERSION }}-${{ hashFiles('**/go.sum') }}
restore-keys: |
${{ runner.os }}-go-${{ env.GO_VERSION }}-
- name: Report
run: go test ./... -race -coverprofile=./cover.txt -covermode=atomic
- name: Upload
uses: codecov/codecov-action@v5.1.0
with:
token: ${{ secrets.CODECOV_TOKEN }}
file: ./cover.txt
flags: unittests
fail_ci_if_error: true