👷 Added GitLab CI config

This commit is contained in:
Maxim Lebedev 2019-05-24 14:30:27 +05:00
parent aebbd0d637
commit 2d4f5bf991
No known key found for this signature in database
GPG key ID: F8978F46FF0FFA4F

31
.gitlab-ci.yml Normal file
View 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