-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathMakefile
More file actions
38 lines (26 loc) · 848 Bytes
/
Copy pathMakefile
File metadata and controls
38 lines (26 loc) · 848 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
PROJECT_NAME := "github.com/fox-one/echo"
PKG := "$(PROJECT_NAME)"
PKG_LIST := $(shell go list ${PKG}/... | grep -v /vendor/)
GO_FILES := $(shell find . -name '*.go' | grep -v /vendor/ | grep -v _test.go)
.PHONY: all dep lint vet test test-coverage echob echos build clean
all: build
dep: ## Get the dependencies
@go mod download
lint: ## Lint Golang files
@golangci-lint run
vet: ## Run go vet
@go vet ${PKG_LIST}
test: ## Run unittests
@go test -short ${PKG_LIST}
test-coverage: ## Run tests with coverage
@go test -short -coverprofile cover.out -covermode=atomic ${PKG_LIST}
@cat cover.out >> coverage.txt
echob:
@go build -o build/echob ./cmd/echob
echos:
@go build -o build/echos ./cmd/echos
scanner:
@go build -o build/scanner ./cmd/scanner
build: dep echob echos scanner
clean: ## Remove previous build
@rm -rf ./build