Skip to content
Snippets Groups Projects
Commit 435182d4 authored by Ken Brooks's avatar Ken Brooks
Browse files

adding tidy, test, fmt, and ci

parent 506f5ad5
Branches configurable-ci-setup-lookup-path
No related tags found
No related merge requests found
ARCH := darwin/amd64 linux/386 linux/amd64 windows/386 windows/amd64
VERSION := $(shell git describe --always --dirty)
LDFLAGS := -ldflags "-X main.version=${VERSION}"
BUILD_DIR := build
BINARY_NAME ?= yajsv
yajsv: *.go
.PHONY: build
build: *.go
go build ${LDFLAGS}
.PHONY: release
release: *.go
gox -output 'build/{{.Dir}}.{{.OS}}.{{.Arch}}' -osarch "${ARCH}" ${LDFLAGS}
gox -output '${BUILD_DIR}/{{.Dir}}.{{.OS}}.{{.Arch}}' -osarch "${ARCH}" ${LDFLAGS}
.PHONY: clean
clean:
rm -rf build yajsv
$(eval BINARY := ${BINARY_NAME}$(if $(findstring windows,$(GOOS)),.exe,))
rm -rf ${BUILD_DIR} ${BINARY} coverage.out
.PHONY: fmt
fmt:
go fmt ./...
.PHONY: tidy
tidy:
go mod tidy -v
.PHONY: test
test:
go test -coverprofile=coverage.out ./...
.PHONY: ci
ci: clean test build
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment