Skip to content

Commit 06cbd35

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 06cbd35

File tree

3 files changed

+26
-0
lines changed

3 files changed

+26
-0
lines changed

.github/workflows/testing.yml

+11
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,10 @@ 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+
make coveralls

Makefile

+13
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
11
SHELL := /bin/bash
2+
COVERAGE_FILE := coverage.out
23

34
.PHONY: clean
45
clean:
56
( cd ./queue; rm -rf .rocks )
7+
rm -f $(COVERAGE_FILE)
68

79
.PHONY: deps
810
deps: clean
@@ -12,3 +14,14 @@ deps: clean
1214
test:
1315
go clean -testcache
1416
go test ./... -v -p 1
17+
18+
.PHONY: coverage
19+
coverage:
20+
go clean -testcache
21+
go get golang.org/x/tools/cmd/cover
22+
go test ./... -v -p 1 -covermode=count -coverprofile=$(COVERAGE_FILE)
23+
24+
.PHONY: coveralls
25+
coveralls: coverage
26+
go install github.com/mattn/goveralls
27+
goveralls -coverprofile=$(COVERAGE_FILE) -service=github

README.md

+2
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)