Skip to content

Commit 7be3b39

Browse files
committed
Github Actions: Add coverage step
1 parent 9b6284f commit 7be3b39

1 file changed

Lines changed: 24 additions & 2 deletions

File tree

.github/workflows/test.yml

Lines changed: 24 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,5 +14,27 @@ jobs:
1414
go-version: ${{ matrix.go-version }}
1515
- name: Checkout code
1616
uses: actions/checkout@v2
17-
- name: Test
18-
run: go test -v -cover ./...
17+
- name: Run unit tests
18+
run: go test -v -race -cover
19+
20+
coverage:
21+
runs-on: ubuntu-latest
22+
steps:
23+
- name: Install Go
24+
uses: actions/setup-go@v2
25+
with:
26+
go-version: 1.14.x
27+
- name: Checkout code
28+
uses: actions/checkout@v2
29+
- name: Run unit tests with coverage
30+
run: go test -v -race -coverprofile=coverage.out
31+
- name: Convert coverage to lcov
32+
uses: jandelgado/gcov2lcov-action@v1.0.2
33+
with:
34+
infile: coverage.out
35+
outfile: coverage.lcov
36+
- name: Coveralls
37+
uses: coverallsapp/github-action@v1.1.1
38+
with:
39+
github-token: ${{ secrets.GITHUB_TOKEN }}
40+
path-to-lcov: coverage.lcov

0 commit comments

Comments
 (0)