-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy pathMakefile
46 lines (39 loc) · 1.2 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
MYGOBIN = $(shell go env GOBIN)
ifeq ($(MYGOBIN),)
MYGOBIN = $(shell go env GOPATH)/bin
endif
# Perform a local build.
# To build an actual release, use the 'release' target instead.
$(MYGOBIN)/mdrip:
releasing/build.sh
.PHONY: test
test: testUnit testE2E
# Run an end-to-end test.
.PHONY: testE2E
testE2E: $(MYGOBIN)/mdrip
./releasing/testE2E.sh $(MYGOBIN)/mdrip
# Run unit tests without a clean (allow reliance on the test cache).
.PHONY: testUnit
testUnit:
go test ./...
# There's a wee bit of code to generate for enums.
.PHONY: generate
generate:
go generate ./...
.PHONY: clean
clean:
rm -f $(MYGOBIN)/mdrip
rm -f ./internal/webapp/widget/*/widget.html
go clean
go clean -testcache
# Force serial execution of dependencies.
# This only matters for build targets that declare multiple dependencies,
# and it forces those dependencies to be built serially in the order that
# they appear in the dependencies list.
.NOTPARALLEL:
# Create a draft release and push it to github.
# Requires go, git, zip, tar, gh (github cli) and env var GH_TOKEN.
# Complains if workspace is dirty, tests fail, tags don't make sense, etc.
.PHONY: release
release: clean testUnit testE2E
(cd releasing; go run . `realpath ..`)