Skip to content

Commit

Permalink
add go report card to readme
Browse files Browse the repository at this point in the history
  • Loading branch information
philbrookes committed Feb 12, 2018
1 parent b7e51e7 commit 5621e9d
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 2 deletions.
9 changes: 7 additions & 2 deletions Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -38,11 +38,16 @@ podTemplate(label: 'mobile-cli-go', cloud: "openshift", containers: [goSlaveCont

stage ("Setup") {
sh "glide install"
sh "go get golang.org/x/tools/cmd/cover"
sh "go get github.com/mattn/goveralls"
}

stage ("Build") {
sh "make build"
withCredentials([string(credentialsId: "coveralls_io", variable: 'COVERALLS_TOKEN')]) {
stage ("Build") {
sh "make coveralls_build COVERALLS_TOKEN=${COVERALLS_TOKEN}"
}
}

def project = sanitizeObjectName("mobile-cli-${env.CHANGE_AUTHOR}-${env.BUILD_TAG}")
stage ("Run") {
// workaround because of the https://issues.jboss.org/browse/FH-4471
Expand Down
13 changes: 13 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,9 @@ setup:
.PHONY: build
build: setup check build_binary

.PHONY: coveralls_build
coveralls_build: setup coveralls_check build_binary

.PHONY: build_binary_linux
build_binary_linux:
env GOOS=linux GOARCH=amd64 go build -o mobile ./cmd/mobile
Expand All @@ -33,6 +36,13 @@ test-unit:
go test -v -race -cover $(UNIT_TEST_FLAGS) \
$(addprefix $(PKG)/,$(TEST_DIRS))

.PHONY: coveralls_test-unit
coveralls_test-unit:
@echo Running tests:
go test -v -race -cover -covermode=atomic -coverprofile=coverage.out $(UNIT_TEST_FLAGS) \
$(addprefix $(PKG)/,$(TEST_DIRS))
goveralls -coverprofile=coverage.out -service=jenkins-ci -repotoken $(COVERALLS_TOKEN)

.PHONY: integration
integration: build_binary
go test -v ./integration -args -namespace=`oc project -q` -executable=`pwd`/mobile
Expand All @@ -54,6 +64,9 @@ fmt:
.PHONY: check
check: errcheck vet fmt test-unit

.PHONY: coveralls_check
coveralls_check: errcheck vet fmt coveralls_test-unit

integration_binary:
go test -c -v ./integration

Expand Down
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
[![Go Report Card](https://goreportcard.com/badge/github.com/golang/crypto)](https://goreportcard.com/report/github.com/golang/crypto)

[![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)

## The Mobile CLI is a standalone CLI that can also be used a kubectl / oc plugin

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

0 comments on commit 5621e9d

Please sign in to comment.