envoid/Makefile
Sagi Dayan 22bb2adcaf
Some checks failed
CI / check for spelling errors (pull_request) Successful in 20s
CI / code quality (lint/tests) (pull_request) Failing after 24s
CI / make sure build does not fail (pull_request) Has been skipped
CI / notify-fail (pull_request) Successful in 14s
Added lint to the CI. formatted all code accordingly
Signed-off-by: Sagi Dayan <sagidayan@gmail.com>
2024-12-17 13:06:41 +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