42 lines
821 B
YAML
42 lines
821 B
YAML
|
image: golang:alpine
|
||
|
|
||
|
cache:
|
||
|
paths:
|
||
|
- /go/src/github.com
|
||
|
- /go/src/gitlab.com
|
||
|
- /go/src/golang.org
|
||
|
- /go/src/google.golang.org
|
||
|
- /go/src/gopkg.in
|
||
|
|
||
|
stages:
|
||
|
- test
|
||
|
|
||
|
before_script:
|
||
|
- apk add --no-cache git build-base bash
|
||
|
- mkdir -p /go/src/gitlab.com/$CI_PROJECT_NAMESPACE /go/src/_/builds
|
||
|
- cp -r $CI_PROJECT_DIR /go/src/gitlab.com/$CI_PROJECT_PATH
|
||
|
- ln -s /go/src/gitlab.com/$CI_PROJECT_NAMESPACE /go/src/_/builds/$CI_PROJECT_NAMESPACE
|
||
|
- make dep
|
||
|
|
||
|
unit_tests:
|
||
|
stage: test
|
||
|
script:
|
||
|
- make test
|
||
|
|
||
|
.race_detector:
|
||
|
stage: test
|
||
|
script:
|
||
|
- make race
|
||
|
|
||
|
code_coverage:
|
||
|
stage: test
|
||
|
script:
|
||
|
- make coverage
|
||
|
|
||
|
lint_code:
|
||
|
stage: test
|
||
|
script:
|
||
|
- go get github.com/go-critic/go-critic/cmd/gocritic
|
||
|
- go install github.com/go-critic/go-critic/cmd/gocritic
|
||
|
- make lint
|