rove/Makefile

33 lines
1,011 B
Makefile
Raw Normal View History

VERSION := $(shell git describe --always --long --dirty --tags)
build:
go mod download
go build -ldflags="-X 'github.com/mdiluz/rove/pkg/version.Version=${VERSION}'" ./...
install:
go mod download
go install -ldflags="-X 'github.com/mdiluz/rove/pkg/version.Version=${VERSION}'" ./...
gen:
protoc --proto_path pkg/accounts --go_out=plugins=grpc:pkg/accounts/ --go_opt=paths=source_relative pkg/accounts/accounts.proto
2020-06-06 18:49:25 +01:00
test:
2020-06-07 23:20:39 +01:00
go mod download
go build ./...
# Run the server and shut it down again to ensure our docker-compose works
ROVE_ARGS="--quit 1" docker-compose up --build --exit-code-from=rove-server --abort-on-container-exit
# Run the server and shut it down again to ensure our docker-compose works
docker-compose up -d
# Run tests with coverage and integration tags
go test -v ./... --tags=integration -cover -coverprofile=/tmp/c.out -count 1
#
docker-compose down
2020-06-07 23:20:39 +01:00
# Convert the coverage data to html
go tool cover -html=/tmp/c.out -o /tmp/coverage.html
2020-06-06 18:49:25 +01:00
.PHONY: install test