-
Notifications
You must be signed in to change notification settings - Fork 7
Expand file tree
/
Copy pathMakefile
More file actions
55 lines (44 loc) · 1.08 KB
/
Copy pathMakefile
File metadata and controls
55 lines (44 loc) · 1.08 KB
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
PACKAGES = $(shell go list ./...)
GO := CGO_ENABLED=0 go
GOFUMPT_VERSION := v0.7.0
APIDIFF_VERSION := v0.0.0-20260811152304-ee035b5b010f
GOFUMPT ?= gofumpt
.PHONY: all
all: build
.PHONY: tools
tools:
$(GO) install mvdan.cc/gofumpt@$(GOFUMPT_VERSION)
$(GO) install golang.org/x/exp/cmd/apidiff@$(APIDIFF_VERSION)
.PHONY: apidiff
apidiff:
./scripts/apidiff.sh
.PHONY: clean
clean:
$(GO) clean -i ./...
rm -rf ./bin/
.PHONY: format
format:
$(GOFUMPT) -extra -w gen githubevents
.PHONY: test
test:
@for PKG in $(PACKAGES); do $(GO) test -cover $$PKG || exit 1; done;
.PHONY: test-race
test-race:
CGO_ENABLED=1 go test -race ./...
.PHONY: generate
generate: build
./bin/githubhook-gen --output=githubevents
$(GOFUMPT) -extra -w githubevents
.PHONY: build
build: \
bin/gen
.PHONY: bin/gen
bin/gen:
mkdir -p bin
$(GO) build -v -ldflags '-w $(LDFLAGS)' -o ./bin/githubhook-gen ./gen/*.go
.PHONY: tidy
tidy:
$(GO) mod tidy
cd examples/simple-http-server && $(GO) mod tidy
cd examples/simple-http-server-funcs && $(GO) mod tidy
cd examples/simple-http-server-packages && $(GO) mod tidy