Skip to content

Commit

Permalink
feat(ci): add codecov (#146)
Browse files Browse the repository at this point in the history
  • Loading branch information
Joshua-Anderson committed Jul 28, 2016
1 parent f94b05f commit 1199b9e
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 6 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -26,3 +26,4 @@ vendor
deis
_dist
workflow-cli
coverage.txt
6 changes: 5 additions & 1 deletion Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,11 @@ node('linux') {
stage 'Install Linux'
make 'bootstrap'
stage 'Test Linux'
make 'test'
make 'test-cover'
stage 'Upload to Codeconv'
withCredentials([[$class: 'StringBinding', credentialsId: '995d99a7-466b-4beb-bf75-f3ba91cbbc18', variable: 'CODECOV_TOKEN']]) {
sh 'curl -s https://codecov.io/bash | bash'
}
}
}

Expand Down
10 changes: 5 additions & 5 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ GO_LDFLAGS = -ldflags "-s -X ${repo_path}/version.BuildVersion=${VERSION}"
GO_PACKAGES = cmd parser cli $(wildcard pkg/*)
GO_PACKAGES_REPO_PATH = $(addprefix $(repo_path)/,$(GO_PACKAGES))
GOFMT = gofmtresult=$$(gofmt -e -l -s ${GO_FILES} ${GO_PACKAGES}); if [[ -n $$gofmtresult ]]; then echo "gofmt errors found in the following files: $${gofmtresult}"; false; fi;
GOTEST = go test --cover --race -v
GOTEST = go test --race -v

# The tag of the commit
GIT_TAG := $(shell git tag -l --contains HEAD)
Expand Down Expand Up @@ -63,7 +63,6 @@ endif

build-all: build-latest build-revision


binary-build:
${DEV_ENV_PREFIX} -e GOOS=${GOOS} ${DEV_ENV_IMAGE} go build -a -installsuffix cgo ${GO_LDFLAGS} -o deis .

Expand All @@ -88,18 +87,19 @@ setup-gotools:
go get -u golang.org/x/tools/cmd/cover
go get -u golang.org/x/tools/cmd/vet

test: test-style test-unit

test-style:
${DEV_ENV_CMD} bash -c '${GOFMT}'
${DEV_ENV_CMD} sh -c 'go vet $(repo_path) $(GO_PACKAGES_REPO_PATH)'
@for i in $(addsuffix /...,$(GO_PACKAGES)); do \
${DEV_ENV_CMD} golint $$i; \
done

test-unit:
test: test-style
${DEV_ENV_PREFIX_CGO_ENABLED} ${DEV_ENV_IMAGE} sh -c '${GOTEST} $$(glide nv)'

test-cover: test-style
${DEV_ENV_PREFIX_CGO_ENABLED} ${DEV_ENV_IMAGE} test-cover.sh

# Set local user as owner for files
fileperms:
${DEV_ENV_PREFIX_CGO_ENABLED} ${DEV_ENV_IMAGE} chown -R ${UID}:${GID} .
3 changes: 3 additions & 0 deletions codecov.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
codecov:
branch: master
slug: "deis/workflow-cli"

0 comments on commit 1199b9e

Please sign in to comment.