Skip to content

Commit 1199b9e

Browse files
feat(ci): add codecov (#146)
1 parent f94b05f commit 1199b9e

4 files changed

Lines changed: 14 additions & 6 deletions

File tree

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,3 +26,4 @@ vendor
2626
deis
2727
_dist
2828
workflow-cli
29+
coverage.txt

Jenkinsfile

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,11 @@ node('linux') {
8383
stage 'Install Linux'
8484
make 'bootstrap'
8585
stage 'Test Linux'
86-
make 'test'
86+
make 'test-cover'
87+
stage 'Upload to Codeconv'
88+
withCredentials([[$class: 'StringBinding', credentialsId: '995d99a7-466b-4beb-bf75-f3ba91cbbc18', variable: 'CODECOV_TOKEN']]) {
89+
sh 'curl -s https://codecov.io/bash | bash'
90+
}
8791
}
8892
}
8993

Makefile

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ GO_LDFLAGS = -ldflags "-s -X ${repo_path}/version.BuildVersion=${VERSION}"
2323
GO_PACKAGES = cmd parser cli $(wildcard pkg/*)
2424
GO_PACKAGES_REPO_PATH = $(addprefix $(repo_path)/,$(GO_PACKAGES))
2525
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;
26-
GOTEST = go test --cover --race -v
26+
GOTEST = go test --race -v
2727

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

6464
build-all: build-latest build-revision
6565

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

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

91-
test: test-style test-unit
92-
9390
test-style:
9491
${DEV_ENV_CMD} bash -c '${GOFMT}'
9592
${DEV_ENV_CMD} sh -c 'go vet $(repo_path) $(GO_PACKAGES_REPO_PATH)'
9693
@for i in $(addsuffix /...,$(GO_PACKAGES)); do \
9794
${DEV_ENV_CMD} golint $$i; \
9895
done
9996

100-
test-unit:
97+
test: test-style
10198
${DEV_ENV_PREFIX_CGO_ENABLED} ${DEV_ENV_IMAGE} sh -c '${GOTEST} $$(glide nv)'
10299

100+
test-cover: test-style
101+
${DEV_ENV_PREFIX_CGO_ENABLED} ${DEV_ENV_IMAGE} test-cover.sh
102+
103103
# Set local user as owner for files
104104
fileperms:
105105
${DEV_ENV_PREFIX_CGO_ENABLED} ${DEV_ENV_IMAGE} chown -R ${UID}:${GID} .

codecov.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
codecov:
2+
branch: master
3+
slug: "deis/workflow-cli"

0 commit comments

Comments
 (0)