-
Notifications
You must be signed in to change notification settings - Fork 4
/
Makefile
45 lines (38 loc) · 977 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
GOLANG_CI_LINT_VER:=v1.59.1
OUT_BIN?=${PWD}/bin/gherkingen
COVER_PACKAGES=./...
VERSION?=${shell git describe --tags}
build:
@echo "building ${VERSION}"
go build \
-o ${OUT_BIN} \
--ldflags "-s -w -X main.version=${VERSION}" \
cmd/gherkingen/main.go
.PHONY: build
lint: bin/golangci-lint-${GOLANG_CI_LINT_VER}
./bin/golangci-lint-${GOLANG_CI_LINT_VER} run
.PHONY: lint
test:
go test \
-coverpkg=${COVER_PACKAGES} \
-covermode=count \
-coverprofile=coverage.out \
./...
go tool cover -func=coverage.out
.PHONY: test
generate:
sh scripts/examples.sh
.PHONY: generate
check.generate: generate
git diff --exit-code internal/generator/examples
.PHONY: check.generate
vendor:
go mod tidy
go mod vendor
.PHONY: vendor
bin/golangci-lint-${GOLANG_CI_LINT_VER}:
curl \
-sSfL \
https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh \
| sh -s $(GOLANG_CI_LINT_VER)
mv ./bin/golangci-lint ./bin/golangci-lint-${GOLANG_CI_LINT_VER}