envoid/Makefile
Sagi Dayan 1e9739edfd
Some checks failed
ci/ci / Check for spelling errors (pull_request) Successful in 2m56s
ci/ci / Code quality (pull_request) Failing after 1s
ci/ci / Make sure build does not fail (pull_request) Successful in 15m41s
ci/ci / notify-fail (pull_request) Has been skipped
Added lint to the CI. formatted all code accordingly
Signed-off-by: Sagi Dayan <sagidayan@gmail.com>
2024-12-16 23:17:36 +02:00

46 lines
988 B
Makefile

BINARY_NAME=envoid
VERSION=1.0.0-alpha
BUILD_FOLDER=build
GO_BUILD_LD_FLAGS=-ldflags="-s -w -X 'git.dayanhub.com/sagi/envoid/internal/variables.Commit=$(shell git rev-parse --short HEAD)' \
-X 'git.dayanhub.com/sagi/envoid/internal/variables.Version=${VERSION}'"
.PHONY: build
build:
GOARCH=amd64 GOOS=linux go build ${GO_BUILD_LD_FLAGS} -o ${BUILD_FOLDER}/${BINARY_NAME}-linux main.go
GOARCH=amd64 GOOS=darwin go build ${GO_BUILD_LD_FLAGS} -o ${BUILD_FOLDER}/${BINARY_NAME}-darwin main.go
#GOARCH=amd64 GOOS=windows go build ${GO_BUILD_LD_FLAGS} -o ${BUILD_FOLDER}/${BINARY_NAME}-windows main.go
.PHONY: clean
clean:
go clean
rm -rf ${BUILD_FOLDER}
rm -rf ./docs
.PHONY: test
test:
go test ./...
.PHONY: test_coverage
test_coverage:
go test ./... -coverprofile=coverage.out
.PHONY: dep
dep:
go mod tidy
go mod vendor
.PHONY: vet
vet:
go vet
.PHONY: lint
lint:
golangci-lint run --enable-all
.PHONY: doc-gen
doc-gen:
rm -rf ./docs
mkdir ./docs
go run . doc