Skip to content

Commit

Permalink
Change the code coverage
Browse files Browse the repository at this point in the history
Remove the coveralls to use codecov.
  • Loading branch information
faabiosr committed Jan 21, 2020
1 parent ee6e63e commit eee6d59
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 14 deletions.
3 changes: 1 addition & 2 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
*.swp
*.swo
cover.*
cover*
cache-dir/*
vendor
13 changes: 8 additions & 5 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
language: go

go:
- "1.12.x"
- "1.13.x"
- master

env:
- GO111MODULE=on

services:
- memcached
Expand All @@ -11,10 +14,10 @@ services:

before_install:
- curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $(go env GOPATH)/bin v1.23.1
- go get github.com/axw/gocov/gocov
- go get github.com/mattn/goveralls
- if ! go get github.com/golang/tools/cmd/cover; then go get golang.org/x/tools/cmd/cover; fi

script:
- $GOPATH/bin/golangci-lint run ./...
- $HOME/gopath/bin/goveralls -service=travis-ci
- make test

after_success:
- bash <(curl -s https://codecov.io/bash)
13 changes: 7 additions & 6 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,30 +2,31 @@

# Clean up
clean:
rm -fR ./cover.*
@rm -fR ./coverage*
.PHONY: clean

# Run tests and generates html coverage file
cover: test
go tool cover -html=./cover.out -o ./cover.html
@go tool cover -html=./coverage.text -o ./coverage.html
@test -f ./coverage.text && rm ./coverage.text;
.PHONY: cover

# Up the docker container for testing
docker:
docker-compose up -d
@docker-compose up -d
.PHONY: docker

# Format all go files
fmt:
gofmt -s -w -l $(shell go list -f {{.Dir}} ./... | grep -v /vendor/)
@gofmt -s -w -l $(shell go list -f {{.Dir}} ./...)
.PHONY: fmt

# Run linters
lint:
golangci-linter run ./...
@golangci-linter run ./...
.PHONY: lint

# Run tests
test:
go test -v -race -coverprofile=./cover.out $(shell go list ./... | grep -v /vendor/)
@go test -v -race -coverprofile=./coverage.text -covermode=atomic $(shell go list ./...)
.PHONY: test
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Cachego

[![Build Status](https://img.shields.io/travis/faabiosr/cachego/master.svg?style=flat-square)](https://travis-ci.org/faabiosr/cachego)
[![Coverage Status](https://img.shields.io/coveralls/faabiosr/cachego/master.svg?style=flat-square)](https://coveralls.io/github/faabiosr/cachego?branch=master)
[![Codecov branch](https://img.shields.io/codecov/c/github/faabiosr/cachego/master.svg?style=flat-square)](https://codecov.io/gh/faabiosr/cachego)
[![GoDoc](https://img.shields.io/badge/godoc-reference-5272B4.svg?style=flat-square)](https://godoc.org/github.com/faabiosr/cachego)
[![Go Report Card](https://goreportcard.com/badge/github.com/faabiosr/cachego?style=flat-square)](https://goreportcard.com/report/github.com/faabiosr/cachego)
[![License](https://img.shields.io/badge/License-MIT-blue.svg?style=flat-square)](https://github.com/faabiosr/cachego/blob/master/LICENSE)
Expand Down

0 comments on commit eee6d59

Please sign in to comment.