Enable droneCI
continuous-integration/drone/push Build was killed
Details
continuous-integration/drone/push Build was killed
Details
parent
2e6dbe4d20
commit
609fd0e2ef
|
@ -0,0 +1,14 @@
|
|||
kind: pipeline
|
||||
type: exec
|
||||
name: pipeline
|
||||
|
||||
steps:
|
||||
- name: lint
|
||||
image: golang
|
||||
commands:
|
||||
- make lint
|
||||
|
||||
- name: test with race and cover
|
||||
image: golang
|
||||
commands:
|
||||
- make test
|
34
.travis.yml
34
.travis.yml
|
@ -1,34 +0,0 @@
|
|||
language: go
|
||||
|
||||
go:
|
||||
- "1.14"
|
||||
|
||||
os:
|
||||
- linux
|
||||
|
||||
git:
|
||||
depth: 1
|
||||
quiet: true
|
||||
submodules: false
|
||||
|
||||
notifications:
|
||||
email: true
|
||||
|
||||
env:
|
||||
global:
|
||||
- GO111MODULE=on
|
||||
- GOPROXY=https://proxy.golang.org
|
||||
- BRANCH="${TRAVIS_PULL_REQUEST_BRANCH:-$TRAVIS_BRANCH}"
|
||||
|
||||
stages:
|
||||
- name: Tests
|
||||
|
||||
jobs:
|
||||
include:
|
||||
- stage: "Tests"
|
||||
name: "Makefile"
|
||||
install: go mod download
|
||||
script:
|
||||
- make lint
|
||||
- make test
|
||||
if: (type = push) OR (type = pull_request)
|
18
Makefile
18
Makefile
|
@ -1,9 +1,13 @@
|
|||
lint: install-lint-deps
|
||||
golangci-lint run ./core/...
|
||||
PROJECT_NAME=modules
|
||||
|
||||
test:
|
||||
go test -race -timeout 30s ./core/...
|
||||
.PHONY: lint
|
||||
lint: ## Линт всего проекта
|
||||
curl -sfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh| sh -s -- -b $(go env GOPATH)/bin v1.51.1
|
||||
golangci-lint run --config=./golangci.yml ./...
|
||||
|
||||
install-lint-deps:
|
||||
(which golangci-lint > /dev/null) || curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $(shell go env GOPATH)/bin
|
||||
.PHONY: lint test
|
||||
.PHONY: test
|
||||
test: ## Юнит тестирование всего проекта
|
||||
go test -race -count 100 -timeout 30s ./...
|
||||
|
||||
help: ## Print this help and exit
|
||||
@grep -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-30s\033[0m %s\n", $$1, $$2}'
|
||||
|
|
Loading…
Reference in New Issue