From 2d4f5bf99177d66fd5c1fea15deb433262a17cd6 Mon Sep 17 00:00:00 2001 From: Maxim Lebedev Date: Fri, 24 May 2019 14:30:27 +0500 Subject: [PATCH] :construction_worker: Added GitLab CI config --- .gitlab-ci.yml | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100644 .gitlab-ci.yml diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml new file mode 100644 index 0000000..7e03afd --- /dev/null +++ b/.gitlab-ci.yml @@ -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