-
Notifications
You must be signed in to change notification settings - Fork 57
/
Makefile
44 lines (33 loc) · 1.31 KB
/
Makefile
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
39
40
41
42
43
44
NOW=`date '+%Y.%m.%d %H:%M:%S'`
OS=`uname -n -m`
AFTER_COMMIT=`git rev-parse HEAD`
GOPATH_DIR=`go env GOPATH`
BIN_NAME=noverify
PKG=github.com/VKCOM/noverify/src/cmd
VERSION=0.5.3
install:
go install -ldflags "-X '$(PKG).BuildVersion=$(VERSION)' -X '$(PKG).BuildTime=$(NOW)' -X '$(PKG).BuildOSUname=$(OS)' -X '$(PKG).BuildCommit=$(AFTER_COMMIT)'" .
build: clear
go build -ldflags "-X '$(PKG).BuildVersion=$(VERSION)' -X '$(PKG).BuildTime=$(NOW)' -X '$(PKG).BuildOSUname=$(OS)' -X '$(PKG).BuildCommit=$(AFTER_COMMIT)'" -o build/$(BIN_NAME)
release:
go run ./_script/release.go -build-version="$(VERSION)" -build-time="$(NOW)" -build-uname="$(OS)" -build-commit="$(AFTER_COMMIT)"
generate_checkers_doc: build
./build/noverify checkers-doc > docs/checkers_doc.md
playground_build:
cd ./playground && $(MAKE) build
playground:
cd ./playground && $(MAKE) run
check: lint test
lint:
@curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $(GOPATH_DIR)/bin v1.59.1
@echo "running linters..."
@$(GOPATH_DIR)/bin/golangci-lint run ./src/...
@echo "no linter errors found"
test:
@echo "running tests..."
@go test -tags tracing -count 3 -race -v ./src/...
@go test -race ./example/custom
@echo "tests passed"
clear:
if [ -d build ]; then rm -r build; fi
.PHONY: check release