Skip to content

Commit 4daf6c4

Browse files
committed
add go report card to readme
1 parent b7e51e7 commit 4daf6c4

File tree

3 files changed

+25
-2
lines changed

3 files changed

+25
-2
lines changed

Jenkinsfile

+7-2
Original file line numberDiff line numberDiff line change
@@ -38,11 +38,16 @@ podTemplate(label: 'mobile-cli-go', cloud: "openshift", containers: [goSlaveCont
3838

3939
stage ("Setup") {
4040
sh "glide install"
41+
sh "go get golang.org/x/tools/cmd/cover"
42+
sh "go get github.com/mattn/goveralls"
4143
}
4244

43-
stage ("Build") {
44-
sh "make build"
45+
withCredentials([string(credentialsId: "coveralls_io", variable: 'COVERALLS_TOKEN')]) {
46+
stage ("Build") {
47+
sh "make coveralls_build COVERALLS_TOKEN=${COVERALLS_TOKEN}"
48+
}
4549
}
50+
4651
def project = sanitizeObjectName("mobile-cli-${env.CHANGE_AUTHOR}-${env.BUILD_TAG}")
4752
stage ("Run") {
4853
// workaround because of the https://issues.jboss.org/browse/FH-4471

Makefile

+13
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,9 @@ setup:
1515
.PHONY: build
1616
build: setup check build_binary
1717

18+
.PHONY: coveralls_build
19+
coveralls_build: setup coveralls_check build_binary
20+
1821
.PHONY: build_binary_linux
1922
build_binary_linux:
2023
env GOOS=linux GOARCH=amd64 go build -o mobile ./cmd/mobile
@@ -33,6 +36,13 @@ test-unit:
3336
go test -v -race -cover $(UNIT_TEST_FLAGS) \
3437
$(addprefix $(PKG)/,$(TEST_DIRS))
3538

39+
.PHONY: coveralls_test-unit
40+
coveralls_test-unit:
41+
@echo Running tests:
42+
go test -v -race -cover -covermode=atomic -coverprofile=coverage.out $(UNIT_TEST_FLAGS) \
43+
$(addprefix $(PKG)/,$(TEST_DIRS))
44+
goveralls -coverprofile=coverage.out -service=jenkins-ci -repotoken $(COVERALLS_TOKEN)
45+
3646
.PHONY: integration
3747
integration: build_binary
3848
go test -v ./integration -args -namespace=`oc project -q` -executable=`pwd`/mobile
@@ -54,6 +64,9 @@ fmt:
5464
.PHONY: check
5565
check: errcheck vet fmt test-unit
5666

67+
.PHONY: coveralls_check
68+
coveralls_check: errcheck vet fmt coveralls_test-unit
69+
5770
integration_binary:
5871
go test -c -v ./integration
5972

README.md

+5
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
[![Go Report Card](https://goreportcard.com/badge/github.com/golang/crypto)](https://goreportcard.com/report/github.com/golang/crypto)
2+
3+
[![Coverage Status](https://coveralls.io/repos/github/aerogear/mobile-cli/badge.svg?branch=add-go-report-card-to-readme)](https://coveralls.io/github/aerogear/mobile-cli?branch=add-go-report-card-to-readme)
4+
5+
16
## The Mobile CLI is a standalone CLI that can also be used a kubectl / oc plugin
27

38
## Note this is still under construction and not yet fit for use

0 commit comments

Comments
 (0)