-
Notifications
You must be signed in to change notification settings - Fork 14
/
Copy pathMakefile
56 lines (43 loc) · 1.07 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
45
46
47
48
49
50
51
52
53
54
55
56
MAKEFILE_PATH := $(abspath $(dir $(abspath $(lastword $(MAKEFILE_LIST)))))
PATH := $(MAKEFILE_PATH):$(PATH)
export GOBIN := $(MAKEFILE_PATH)/bin
PATH := $(GOBIN):$(PATH)
GOLANGCI_LINT_VERSION ?= $(shell cd tools; go list -m -f '{{.Version}}' github.com/golangci/golangci-lint)
.PHONY: all
all: clean format build lint test
.PHONY: clean
clean:
@echo clean
@go clean
.PHONY: build
build:
@echo build
@go build -o $(GOBIN)/import-gitlab-commits
.PHONY: test
test:
@echo test
@go test -shuffle=on -count=1 -race -v ./...
.PHONY: test-integration
test-integration:
@echo test-integration
@go test -tags=integration -run=TestGitLab -shuffle=on -count=1 -race -v ./...
.PHONY: lint
lint:
@echo lint
@go install github.com/golangci/golangci-lint/cmd/golangci-lint@$(GOLANGCI_LINT_VERSION)
@$(GOBIN)/golangci-lint run
.PHONY: gh-lint-version
gh-lint-version:
@echo "GOLANGCI_LINT_VERSION=$(GOLANGCI_LINT_VERSION)"
.PHONY: format
format:
@echo format
@go fmt $(PKGS)
.PHONY: generate
generate:
@echo generate
@go generate ./...
.PHONY: run
run:
@echo run
@go run -race .