diff --git a/.github/workflows/testing.yml b/.github/workflows/testing.yml index a2d99cfa2..26d1a24d6 100644 --- a/.github/workflows/testing.yml +++ b/.github/workflows/testing.yml @@ -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: @@ -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 diff --git a/Makefile b/Makefile index ec51cca52..72959eeaf 100644 --- a/Makefile +++ b/Makefile @@ -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 @@ -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 diff --git a/README.md b/README.md index c10ee8212..0cd576994 100644 --- a/README.md +++ b/README.md @@ -5,6 +5,8 @@ +[![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