Skip to content

Support code coverage #149

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Mar 30, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 20 additions & 1 deletion .github/workflows/testing.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,16 +24,28 @@ jobs:
- '1.10'
- '2.8'
- '2.9'
- '2.x-latest'
coveralls: [false]
include:
- tarantool: '2.x-latest'
coveralls: true

steps:
- name: Clone the connector
uses: actions/checkout@v2

- name: Setup tarantool ${{ matrix.tarantool }}
- name: Setup Tarantool ${{ matrix.tarantool }}
if: matrix.tarantool != '2.x-latest'
uses: tarantool/setup-tarantool@v1
with:
tarantool-version: ${{ matrix.tarantool }}

- name: Setup Tarantool 2.x (latest)
if: matrix.tarantool == '2.x-latest'
run: |
curl -L https://tarantool.io/pre-release/2/installer.sh | sudo bash
sudo apt install -y tarantool tarantool-dev

- name: Setup golang for the connector and tests
uses: actions/setup-go@v2
with:
Expand All @@ -44,3 +56,10 @@ jobs:

- name: Run tests
run: make test

- name: Run tests, collect code coverage data and send to Coveralls
if: ${{ matrix.coveralls }}
env:
COVERALLS_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
make coveralls
13 changes: 13 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
SHELL := /bin/bash
COVERAGE_FILE := coverage.out

.PHONY: clean
clean:
( cd ./queue; rm -rf .rocks )
rm -f $(COVERAGE_FILE)

.PHONY: deps
deps: clean
Expand All @@ -12,3 +14,14 @@ deps: clean
test:
go clean -testcache
go test ./... -v -p 1

.PHONY: coverage
coverage:
go clean -testcache
go get golang.org/x/tools/cmd/cover
go test ./... -v -p 1 -covermode=count -coverprofile=$(COVERAGE_FILE)

.PHONY: coveralls
coveralls: coverage
go get github.com/mattn/goveralls
goveralls -coverprofile=$(COVERAGE_FILE) -service=github
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
<img src="https://travis-ci.org/tarantool/go-tarantool.png?branch=master" align="right">
</a-->

[![Coverage Status](https://coveralls.io/repos/github/tarantool/go-tarantool/badge.svg?branch=master)](https://coveralls.io/github/tarantool/go-tarantool?branch=master)

# Client in Go for Tarantool 1.6+

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