Skip to content

Commit ac2e2e8

Browse files
committed
Add Coveralls support
Patch adds an additional job to Github Actions that runs tests with enabled code coverage and send information about coverage to Coveralls, see documentation [1]. Coveralls provides a convenient UI for analysis code coverage [2]. 1. https://docs.coveralls.io/go 2. https://coveralls.io/github/tarantool/go-tarantool
1 parent bec9f72 commit ac2e2e8

File tree

3 files changed

+25
-0
lines changed

3 files changed

+25
-0
lines changed

.github/workflows/testing.yml

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,10 @@ jobs:
2424
- '1.10'
2525
- '2.8'
2626
- '2.9'
27+
coveralls: [false]
28+
include:
29+
- tarantool: '2.9'
30+
coveralls: true
2731

2832
steps:
2933
- name: Clone the connector
@@ -44,3 +48,12 @@ jobs:
4448

4549
- name: Run tests
4650
run: make test
51+
52+
- name: Run tests, collect code coverage data and send to Coveralls
53+
if: ${{ matrix.coveralls }}
54+
env:
55+
COVERALLS_TOKEN: ${{ secrets.GITHUB_TOKEN }}
56+
run: |
57+
go get golang.org/x/tools/cmd/cover
58+
go get github.com/mattn/goveralls
59+
make coveralls

Makefile

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
SHELL := /bin/bash
2+
COVERAGE_FILE := coverage.out
23

34
.PHONY: clean
45
clean:
@@ -12,3 +13,12 @@ deps: clean
1213
test:
1314
go clean -testcache
1415
go test ./... -v -p 1
16+
17+
.PHONY: coverage
18+
coverage:
19+
go clean -testcache
20+
go test ./... -v -p 1 -covermode=count -coverprofile=$(COVERAGE_FILE)
21+
22+
.PHONY: coveralls
23+
coveralls: coverage
24+
goveralls -coverprofile=$(COVERAGE_FILE) -service=github

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@
55
<img src="https://travis-ci.org/tarantool/go-tarantool.png?branch=master" align="right">
66
</a-->
77

8+
[![Coverage Status](https://coveralls.io/repos/github/tarantool/go-tarantool/badge.svg?branch=master)](https://coveralls.io/github/tarantool/go-tarantool?branch=master)
9+
810
# Client in Go for Tarantool 1.6+
911

1012
The `go-tarantool` package has everything necessary for interfacing with

0 commit comments

Comments
 (0)