Skip to content

Commit 16def1b

Browse files
author
Genert Org
committed
feat: add code coverage creation
1 parent ee507a0 commit 16def1b

File tree

1 file changed

+36
-0
lines changed

1 file changed

+36
-0
lines changed

.github/workflows/codecov.yml

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
name: Code coverage generation
2+
on: [push]
3+
jobs:
4+
codecov:
5+
name: Build
6+
runs-on: ubuntu-latest
7+
steps:
8+
- name: Set up Go 1.17
9+
uses: actions/setup-go@v1
10+
with:
11+
go-version: 1.17
12+
13+
- name: Check out code into the Go module directory
14+
uses: actions/checkout@v1
15+
16+
- name: Get dependencies
17+
run: |
18+
go get -v -t -d ./...
19+
if [ -f Gopkg.toml ]; then
20+
curl https://raw.githubusercontent.com/golang/dep/master/install.sh | sh
21+
dep ensure
22+
fi
23+
24+
- name: Generate coverage report
25+
run: |
26+
go test ./... -coverprofile=coverage.txt -covermode=atomic
27+
28+
- name: Upload coverage report
29+
uses: codecov/codecov-action@v1.0.2
30+
with:
31+
token: ${{ secrets.CODECOV_TOKEN }}
32+
file: ./coverage.txt
33+
flags: unittests
34+
name: codecov-umbrella
35+
fail_ci_if_error: true
36+
verbose: true

0 commit comments

Comments
 (0)