Commit 6d8e548b authored by Ma_124's avatar Ma_124

adding options to go test and running upload-cov on success of test

parent 73da3270
Pipeline #46233192 passed with stages
in 2 minutes and 41 seconds
......@@ -3,12 +3,6 @@ image: golang:latest
variables:
REPO_NAME: gitlab.com/Ma_124/awesome-framework
# The problem is that to be able to use go get, one needs to put
# the repository in the $GOPATH. So for example if your gitlab domain
# is gitlab.com, and that your repository is namespace/project, and
# the default GOPATH being /go, then you'd need to have your
# repository in /go/src/gitlab.com/namespace/project
# Thus, making a symbolic link corrects this.
before_script:
- mkdir -p $GOPATH/src/$(dirname $REPO_NAME)
- ln -svf $CI_PROJECT_DIR $GOPATH/src/$REPO_NAME
......@@ -18,13 +12,12 @@ before_script:
stages:
- test
- build
- success
test:
stage: test
script:
- go fmt $(go list ./... | grep -v /vendor/)
- go test -race -cover $(go list ./... | grep -v /vendor/)
- go test -race -cover -coverprofile=profile.out -covermode=atomic $(go list ./... | grep -v /vendor/)
compile:
stage: build
......@@ -35,7 +28,8 @@ compile:
- awesome
upload-cov:
stage: success
stage: test
when: on_success
script:
- bash <(curl -s https://codecov.io/bash)
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment