-
Notifications
You must be signed in to change notification settings - Fork 1
/
Makefile
57 lines (45 loc) · 862 Bytes
/
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
45
46
47
48
49
50
51
52
53
54
55
56
57
BINARY_NAME=playwright
TEST_DIR=test
TEST_ROOT=./$(TEST_DIR)
GO=go
GO_BUILD=$(GO) build
GO_FMT=$(GO) fmt
GO_TEST=$(GO) test -v -p 1 -cover
GO_GET=$(GO) mod vendor
GO_VET=$(GO) vet
GO_INSTALL=$(GO) install
GO_LIST=$(GO) list
STATICCHECK=staticcheck
.PHONY: build
build:
$(GO_BUILD) -o $(BINARY_NAME) pkg/main.go
.PHONY: dependencies
dependencies:
$(GO_GET)
.PHONY: fmt
fmt:
$(GO_FMT) ./...
.PHONY: vet
vet:
$(GO_VET) ./...
.PHONY: lint
lint:
$(STATICCHECK) ./...
.PHONY: test
test:
$(GO_TEST) $$($(GO_LIST) ./... | grep -v $(TEST_DIR))
.PHONY: it
it:
cd $(TEST_ROOT) && $(GO_TEST)
.PHONY: install-native
install-native: build
$(GO_INSTALL)
.PHONY: install
install: build
cp $(BINARY_NAME) /usr/local/bin/$(BINARY_NAME)
.PHONY: clean
clean:
rm -rf $(BINARY_NAME)
.PHONY: prepare
prepare:
go install honnef.co/go/tools/cmd/staticcheck@latest