-
-
Notifications
You must be signed in to change notification settings - Fork 6
/
Makefile
37 lines (31 loc) · 895 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
.PHONY: help
help: ## Show this help message.
@echo 'usage: make [target] ...'
@echo
@echo 'targets:'
@egrep '^(.+)\:\ ##\ (.+)' ${MAKEFILE_LIST} | column -t -c 2 -s ':#'
SRC := $(shell find . -name '*.go')
TARGET = build/convergen
.PHONY: build
build: ## Build cli command
build: $(TARGET)
$(TARGET): $(SRC)
@mkdir -p build
go build -o build/convergen main.go
.PHONY: lint
lint: ## Run linter
lint:
docker run --rm --platform=linux/amd64 \
-v "${PWD}:/src" -w /src \
--rm \
golangci/golangci-lint:latest golangci-lint --go=1.19 run
.PHONY: test
test: ## Run all tests
test:
go test github.com/reedom/convergen/tests && \
go test github.com/reedom/convergen/pkg/...
.PHONY: coverage
coverage:
@go test -v -cover ./... -coverprofile coverage.out -coverpkg ./... 2>&1 >/dev/null && \
go tool cover -func coverage.out -o coverage.out 2>&1 >/dev/null && \
cat coverage.out