2017-06-25 17:51:08 +02:00
|
|
|
SOURCES = $(shell find . -name '*.go')
|
2017-10-29 20:01:33 +01:00
|
|
|
PARSERS = $(shell find . -name '*.treerack')
|
2017-06-25 17:51:08 +02:00
|
|
|
|
|
|
|
default: build
|
|
|
|
|
2017-11-05 03:28:36 +01:00
|
|
|
imports: $(SOURCES)
|
2017-06-25 17:51:08 +02:00
|
|
|
@goimports -w $(SOURCES)
|
|
|
|
|
|
|
|
build: $(SOURCES)
|
|
|
|
go build ./...
|
|
|
|
|
2017-11-05 03:28:36 +01:00
|
|
|
check: imports build $(PARSERS)
|
|
|
|
go test -test.short -run ^Test
|
2017-06-25 17:51:08 +02:00
|
|
|
|
2017-11-05 03:28:36 +01:00
|
|
|
check-all: imports build $(PARSERS)
|
|
|
|
go test
|
2017-10-29 16:47:03 +01:00
|
|
|
|
2017-11-05 03:28:36 +01:00
|
|
|
.coverprofile: $(SOURCES) imports
|
|
|
|
go test -coverprofile .coverprofile
|
|
|
|
|
|
|
|
cover: .coverprofile
|
|
|
|
go tool cover -func .coverprofile
|
|
|
|
|
|
|
|
show-cover: .coverprofile
|
|
|
|
go tool cover -html .coverprofile
|
2017-06-25 17:51:08 +02:00
|
|
|
|
2017-11-05 03:38:24 +01:00
|
|
|
publish-coverage: .coverprofile
|
|
|
|
curl -s https://codecov.io/bash -o codecov
|
|
|
|
CODECOV_TOKEN=a2b0290b-62b6-419f-bf61-4182e479aec4 bash codecov -f .coverprofile
|
|
|
|
|
2017-07-30 05:10:46 +02:00
|
|
|
cpu.out: $(SOURCES) $(PARSERS)
|
2017-07-30 02:35:51 +02:00
|
|
|
go test -v -run TestMMLFile -cpuprofile cpu.out
|
|
|
|
|
|
|
|
cpu: cpu.out
|
|
|
|
go tool pprof -top cpu.out
|
|
|
|
|
2017-11-05 03:28:36 +01:00
|
|
|
fmt: $(SOURCES)
|
|
|
|
@gofmt -w -s $(SOURCES)
|
|
|
|
|
2017-10-29 16:47:03 +01:00
|
|
|
precommit: fmt build check-all
|
2017-07-30 02:35:51 +02:00
|
|
|
|
|
|
|
clean:
|
|
|
|
@rm -f *.test
|
|
|
|
@rm -f cpu.out
|
|
|
|
@go clean -i ./...
|
2017-11-05 03:45:15 +01:00
|
|
|
|
|
|
|
ci-trigger: build check-all
|