👷 Added GitLab CI config
This commit is contained in:
parent
aebbd0d637
commit
2d4f5bf991
1 changed files with 31 additions and 0 deletions
31
.gitlab-ci.yml
Normal file
31
.gitlab-ci.yml
Normal file
|
@ -0,0 +1,31 @@
|
|||
image: golang:alpine
|
||||
|
||||
stages:
|
||||
- test
|
||||
- review
|
||||
|
||||
before_script:
|
||||
- apk add --no-cache git build-base bash make
|
||||
- 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
|
||||
- go get github.com/golangci/golangci-lint/cmd/golangci-lint
|
||||
- go install github.com/golangci/golangci-lint/cmd/golangci-lint
|
||||
- make dep
|
||||
|
||||
unit_tests:
|
||||
stage: test
|
||||
script:
|
||||
- make test
|
||||
|
||||
code_coverage:
|
||||
stage: test
|
||||
script:
|
||||
- make coverage
|
||||
coverage: '/^coverage:\s(\d+(?:\.\d+)?%)/'
|
||||
|
||||
lint_code:
|
||||
stage: review
|
||||
script:
|
||||
- make lint
|
||||
allow_failure: true
|
Loading…
Reference in a new issue