2019-04-12 21:05:11 -04:00
|
|
|
.PHONY: build install compile test e2e doc fmt lint vet release
|
2022-01-12 16:52:07 -05:00
|
|
|
export CGO_ENABLED=0
|
2018-09-18 16:42:38 -04:00
|
|
|
|
|
|
|
DIR_BIN = ./bin
|
|
|
|
DIR_PKG = ./pkg
|
2018-10-14 15:38:14 -04:00
|
|
|
DIR_E2E = ./e2e
|
2018-09-18 16:42:38 -04:00
|
|
|
|
|
|
|
default: build
|
|
|
|
|
2019-03-28 00:24:49 +03:00
|
|
|
build: vet generate test compile
|
2018-09-18 16:42:38 -04:00
|
|
|
|
2019-04-12 21:05:11 -04:00
|
|
|
install:
|
|
|
|
go get
|
|
|
|
|
2018-09-25 21:49:42 -04:00
|
|
|
compile:
|
2022-01-12 16:52:07 -05:00
|
|
|
go build -v -o ${DIR_BIN}/ferret \
|
2021-04-08 18:46:17 -04:00
|
|
|
${DIR_E2E}/cli.go
|
2018-09-18 16:42:38 -04:00
|
|
|
|
|
|
|
test:
|
2022-01-12 16:52:07 -05:00
|
|
|
go test ${DIR_PKG}/...
|
2018-10-16 20:50:06 -04:00
|
|
|
|
|
|
|
cover:
|
2022-01-12 16:52:07 -05:00
|
|
|
go test -coverprofile=coverage.txt -covermode=atomic ${DIR_PKG}/... && \
|
2018-10-25 22:13:41 -04:00
|
|
|
curl -s https://codecov.io/bash | bash
|
2018-09-18 16:42:38 -04:00
|
|
|
|
2018-10-14 15:38:14 -04:00
|
|
|
e2e:
|
2021-04-08 18:46:17 -04:00
|
|
|
lab --timeout=120 --attempts=5 --concurrency=1 --wait=http://127.0.0.1:9222/json/version --runtime=bin://./bin/ferret --files=./e2e/tests --cdn=./e2e/pages/dynamic --cdn=./e2e/pages/static
|
2018-10-14 15:38:14 -04:00
|
|
|
|
2018-10-24 19:40:57 -04:00
|
|
|
bench:
|
|
|
|
go test -run=XXX -bench=. ${DIR_PKG}/...
|
|
|
|
|
2018-09-18 16:42:38 -04:00
|
|
|
generate:
|
2018-09-27 17:03:49 -04:00
|
|
|
go generate ${DIR_PKG}/...
|
2018-09-18 16:42:38 -04:00
|
|
|
|
|
|
|
doc:
|
|
|
|
godoc -http=:6060 -index
|
|
|
|
|
|
|
|
# http://golang.org/cmd/go/#hdr-Run_gofmt_on_package_sources
|
|
|
|
fmt:
|
2021-04-08 18:46:17 -04:00
|
|
|
go fmt ${DIR_PKG}/...
|
2018-09-18 16:42:38 -04:00
|
|
|
|
2018-10-05 18:59:42 -04:00
|
|
|
# https://github.com/mgechev/revive
|
|
|
|
# go get github.com/mgechev/revive
|
2018-09-18 16:42:38 -04:00
|
|
|
lint:
|
2019-09-04 22:57:46 -04:00
|
|
|
revive -config revive.toml -formatter stylish -exclude ./pkg/parser/fql/... -exclude ./vendor/... ./...
|
2018-09-18 16:42:38 -04:00
|
|
|
|
|
|
|
# http://godoc.org/code.google.com/p/go.tools/cmd/vet
|
|
|
|
# go get code.google.com/p/go.tools/cmd/vet
|
|
|
|
vet:
|
2021-04-08 18:46:17 -04:00
|
|
|
go vet ${DIR_PKG}/...
|