forked from TarasLykhenko/VendingMachine
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
44 lines (30 loc) · 955 Bytes
/
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
GOTEST_OUTPUT_RESULTS=testresults.out
GOTEST_OUTPUT_COVERAGE=testcoverageresults.out
# Check where are we running the build
ifdef BUILD_BUILDNUMBER
# CI Build
GOTEST_OUTPUT=-coverprofile=$(GOTEST_OUTPUT_COVERAGE) > $(GOTEST_OUTPUT_RESULTS)
else
# Manual build
GOTEST_OUTPUT=-cover
endif
.DEFAULT_GOAL := default
.PHONY: all
# test.lint:
# go install golang.org/x/lint/golint
# golint -set_exit_status ./...
test.vet:
go vet ./...
test.unit:
go test -v ./... $(GOTEST_OUTPUT)
# test.generate.report:
# go install github.com/jstemmer/go-junit-report
# go install github.com/axw/gocov/gocov
# go install github.com/AlekSi/gocov-xml
# gocov convert $(GOTEST_OUTPUT_COVERAGE) | gocov-xml > coverage.xml
# cat $(GOTEST_OUTPUT_RESULTS) | go-junit-report > report.xml
build.vendingmachine:
$(MAKE) -C ./cmd/vendingmachine
build: build.vendingmachine
# default: test.lint build test.vet test.unit
default: build test.vet test.unit