-
Notifications
You must be signed in to change notification settings - Fork 49
/
Makefile
48 lines (38 loc) · 1.04 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
mkfile_path := $(abspath $(lastword $(MAKEFILE_LIST)))
mkfile_dir := $(dir $(mkfile_path))
.PHONY: build
build:
./provision/before-commit.sh ci
./function/before-commit.sh ci
.PHONY: ci-pr
ci-pr: build
.PHONY: ci-main
ci-main: build
.PHONY: ci-release
ci-release: build
.PHONY: lint-function
lint-function:
./hack/verify-lint.sh $(mkfile_dir)/function
.PHONY: lint-provision
lint-provision:
./hack/verify-lint.sh $(mkfile_dir)/provision
.PHONY: lint
lint: lint-function lint-provision
.PHONY: test-provision
test-provision:
@cd provision; \
echo "Running tests for provision"; \
go test -coverprofile=cover.out ./... ;\
echo "Total test coverage: $$(go tool cover -func=cover.out | grep total | awk '{print $$3}')" ;\
rm cover.out ; \
cd ..;
.PHONY: test-function
test-function:
@cd function; \
echo "Running tests for function"; \
go test -coverprofile=cover.out ./... ;\
echo "Total test coverage: $$(go tool cover -func=cover.out | grep total | awk '{print $$3}')" ;\
rm cover.out ; \
cd ..;
.PHONY: test
test: test-provision test-function