forked from onflow/flowkit
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
61 lines (52 loc) · 1.69 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
50
51
52
53
54
55
56
57
58
59
60
61
# The short Git commit hash
SHORT_COMMIT := $(shell git rev-parse --short HEAD)
# The Git commit hash
COMMIT := $(shell git rev-parse HEAD)
# The tag of the current commit, otherwise empty
VERSION := $(shell git describe --tags --abbrev=0 --exact-match 2>/dev/null)
# Name of the cover profile
COVER_PROFILE := coverage.txt
# Disable go sum database lookup for private repos
GOPRIVATE := github.com/dapperlabs/*
# Ensure go bin path is in path (Especially for CI)
GOPATH ?= $(HOME)/go
PATH := $(PATH):$(GOPATH)/bin
# OS
UNAME := $(shell uname)
MIXPANEL_PROJECT_TOKEN := 3fae49de272be1ceb8cf34119f747073
.PHONY: test
test:
GO111MODULE=on go test -v -coverprofile=$(COVER_PROFILE) $(if $(JSON_OUTPUT),-json,) ./...
.PHONY: install-tools
install-tools:
cd ${GOPATH}; \
mkdir -p ${GOPATH}; \
GO111MODULE=on go install github.com/axw/gocov/gocov@latest; \
GO111MODULE=on go install github.com/matm/gocov-html/cmd/gocov-html@latest; \
GO111MODULE=on go install github.com/sanderhahn/gozip/cmd/gozip@latest; \
GO111MODULE=on go install github.com/vektra/mockery/[email protected];
.PHONY: generate-schema
generate-schema:
go run ./cmd/flow-schema/flow-schema.go ./schema.json
.PHONY: check-schema
check-schema:
go run ./cmd/flow-schema/flow-schema.go --verify=true ./schema.json
.PHONY: check-tidy
check-tidy:
go mod tidy
.PHONY: check-headers
check-headers:
@./check-headers.sh
.PHONY: generate
generate: install-tools
go generate ./...
.PHONY: coverage
coverage:
ifeq ($(COVER), true)
# file has to be called index.html
gocov convert $(COVER_PROFILE) > cover.json
./cover-summary.sh
gocov-html cover.json > index.html
# coverage.zip will automatically be picked up by teamcity
gozip -c coverage.zip index.html
endif