1
0
mirror of https://github.com/MontFerret/ferret.git synced 2025-01-08 03:13:15 +02:00
ferret/Makefile

59 lines
1.4 KiB
Makefile
Raw Permalink Normal View History

.PHONY: build install compile test e2e doc fmt lint vet release
2022-01-12 23:52:07 +02:00
export CGO_ENABLED=0
2018-09-18 22:42:38 +02:00
2023-03-28 19:35:56 +02:00
LAB_BIN ?= lab
2018-09-18 22:42:38 +02:00
DIR_BIN = ./bin
DIR_PKG = ./pkg
2018-10-14 21:38:14 +02:00
DIR_E2E = ./e2e
2018-09-18 22:42:38 +02:00
default: build
build: vet generate test compile
2018-09-18 22:42:38 +02:00
install-tools:
go install honnef.co/go/tools/cmd/staticcheck@latest && \
go install golang.org/x/tools/cmd/goimports@latest && \
go install github.com/mgechev/revive@latest
install:
go get
2018-09-26 03:49:42 +02:00
compile:
2022-01-12 23:52:07 +02:00
go build -v -o ${DIR_BIN}/ferret \
${DIR_E2E}/cli.go
2018-09-18 22:42:38 +02:00
test:
2022-01-12 23:52:07 +02:00
go test ${DIR_PKG}/...
cover:
2022-01-12 23:52:07 +02:00
go test -coverprofile=coverage.txt -covermode=atomic ${DIR_PKG}/... && \
2018-10-26 04:13:41 +02:00
curl -s https://codecov.io/bash | bash
2018-09-18 22:42:38 +02:00
2018-10-14 21:38:14 +02:00
e2e:
2023-03-28 19:35:56 +02:00
${LAB_BIN} --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 21:38:14 +02:00
2018-10-25 01:40:57 +02:00
bench:
go test -run=XXX -bench=. ${DIR_PKG}/...
2018-09-18 22:42:38 +02:00
generate:
2018-09-27 23:03:49 +02:00
go generate ${DIR_PKG}/...
2018-09-18 22:42:38 +02:00
doc:
godoc -http=:6060 -index
# http://golang.org/cmd/go/#hdr-Run_gofmt_on_package_sources
fmt:
go fmt ${DIR_PKG}/... && \
goimports -w -local github.com/MontFerret ./pkg ./e2e
2018-09-18 22:42:38 +02:00
2018-10-06 00:59:42 +02:00
# https://github.com/mgechev/revive
# go get github.com/mgechev/revive
2018-09-18 22:42:38 +02:00
lint:
staticcheck ./pkg/compiler ./pkg/drivers ./pkg/runtime ./pkg/stdlib && \
revive -config revive.toml -formatter stylish -exclude ./pkg/parser/fql/... -exclude ./vendor/... ./...
2018-09-18 22:42:38 +02:00
# http://godoc.org/code.google.com/p/go.tools/cmd/vet
# go get code.google.com/p/go.tools/cmd/vet
vet:
go vet ${DIR_PKG}/...