-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
55 lines (42 loc) · 1017 Bytes
/
Makefile
File metadata and controls
55 lines (42 loc) · 1017 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
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
LOCAL_BIN:=$(CURDIR)/bin
PATH:=$(PATH):$(LOCAL_BIN)
PKG:=github.com/zguydev/openapi-fixer
FIXER_ENTRYPOINT:=.
FIXER_BIN:=$(LOCAL_BIN)/openapi-fixer
GOLANGCI_LINT_VERSION:=v2.1.6
ifneq (,$(wildcard .env))
include .env
export
endif
.PHONY: .app-deps
.app-deps:
go mod tidy
.PHONY: .bin-deps
.bin-deps:
$(info "Installing bin deps...")
@mkdir -p $(LOCAL_BIN)
@GOBIN=$(LOCAL_BIN) go install github.com/golangci/golangci-lint/v2/cmd/golangci-lint@$(GOLANGCI_LINT_VERSION)
.PHONY: install
install: .bin-deps .app-deps
.PHONY: build
build:
@mkdir -p $(LOCAL_BIN)
@go build -o $(FIXER_BIN) $(FIXER_ENTRYPOINT)
.PHONY: clean
clean:
@rm -i $(LOCAL_BIN)/*
.PHONY: lint
lint:
@$(LOCAL_BIN)/golangci-lint run ./...
.PHONY: test
test:
@go test -v -coverprofile=./coverage.out $(PKG)/...
.PHONY: cover
cover:
@go test -cover -coverprofile ./coverage.out $(PKG)/...
.PHONY: show_cover
show_cover:
@go tool cover -func=coverage.out
.PHONY: show_cover_html
show_cover_html:
@go tool cover -html=coverage.out