1
0

👷 Updated CI config

This commit is contained in:
Maxim Lebedev 2019-04-15 17:33:32 +05:00
parent f9c11ddc83
commit 9ab2d0a5c4
No known key found for this signature in database
GPG Key ID: F8978F46FF0FFA4F
2 changed files with 7 additions and 5 deletions

View File

@ -11,7 +11,7 @@ GO_FILES := $(shell find . -name '*.go' | grep -v /vendor/ | grep -v _test.go)
all: build all: build
lint: ## Lint the files lint: ## Lint the files
@gocritic check-project $(PACKAGE_PATH) @golangci-lint run
test: ## Run unittests test: ## Run unittests
@go test -short ${PACKAGE_LIST} @go test -short ${PACKAGE_LIST}

View File

@ -12,10 +12,12 @@ stages:
- test - test
before_script: before_script:
- apk add --no-cache git build-base bash - apk add --no-cache git build-base bash make
- mkdir -p /go/src/gitlab.com/$CI_PROJECT_NAMESPACE /go/src/_/builds - mkdir -p /go/src/gitlab.com/$CI_PROJECT_NAMESPACE /go/src/_/builds
- cp -r $CI_PROJECT_DIR /go/src/gitlab.com/$CI_PROJECT_PATH - 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 - 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 - make dep
unit_tests: unit_tests:
@ -32,10 +34,10 @@ code_coverage:
stage: test stage: test
script: script:
- make coverage - make coverage
coverage: '/^coverage:\s(\d+(?:\.\d+)?%)/'
lint_code: lint_code:
stage: test stage: review
script: script:
- go get github.com/go-critic/go-critic/cmd/gocritic
- go install github.com/go-critic/go-critic/cmd/gocritic
- make lint - make lint
allow_failure: true