Skip to content
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

Add go report card to readme #78

Merged
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
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"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We probably should bake this into the slave image.

}

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
5 changes: 5 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
[![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