-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
49 lines (38 loc) · 1.12 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
47
48
49
#------------------------------------------------------------------------------
# TESTS
#------------------------------------------------------------------------------
.PHONY: test
test:
@make -j test-unit test-e2e
.PHONY: test-e2e
test-e2e:
@go test ./test/...
.PHONY: test-unit
test-unit:
@go test ./internal/...
.PHONY: watch-test
watch-test:
@make -j watch-unit-test watch-e2e-test
.PHONY: watch-unit-test
watch-unit-test:
@cng -ik -e 'test' '**/*.go' -- make test-unit
.PHONY: watch-e2e-test
watch-e2e-test:
@cng -ik '**/*.go' -- make build test-e2e
#------------------------------------------------------------------------------
# BUILDING
#------------------------------------------------------------------------------
.PHONY: build
build:
@echo "🤖 building cng..."
@CGO_ENABLED=0 go build -a -gcflags=all="-l -B" -ldflags="-s -w" -o ./dist/cng ./cmd/cng
@echo "🎉 cng built to dist/cng"
.PHONY: install
install:
@echo "🤖 installing cng..."
@go install ./cmd/cng
@echo "🎉 cng installed to: $(shell which cng)"
.PHONY: watch-install
watch-install:
@cng -ik '**/*.go' -- make install
.DEFAULT_GOAL := watch-test