Skip to content

Commit 31ebde8

Browse files
committed
github-ci: 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 90ee76c commit 31ebde8

File tree

3 files changed

+27
-1
lines changed

3 files changed

+27
-1
lines changed

.github/workflows/testing.yml

+12-1
Original file line numberDiff line numberDiff line change
@@ -25,12 +25,16 @@ jobs:
2525
- '2.8'
2626
- '2.9'
2727
- '2.x-latest'
28+
coveralls: [false]
29+
include:
30+
- tarantool: '2.x-latest'
31+
coveralls: true
2832

2933
steps:
3034
- name: Clone the connector
3135
uses: actions/checkout@v2
3236

33-
- name: Setup Tarantool (version is not equal to latest 2.x)
37+
- name: Setup Tarantool ${{ matrix.tarantool }}
3438
if: matrix.tarantool != '2.x-latest'
3539
uses: tarantool/setup-tarantool@v1
3640
with:
@@ -52,3 +56,10 @@ jobs:
5256

5357
- name: Run tests
5458
run: make test
59+
60+
- name: Run tests, collect code coverage data and send to Coveralls
61+
if: ${{ matrix.coveralls }}
62+
env:
63+
COVERALLS_TOKEN: ${{ secrets.GITHUB_TOKEN }}
64+
run: |
65+
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 get 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)