mirror of
https://github.com/kha7iq/pingme.git
synced 2025-05-15 06:10:12 -07:00
40 lines
1.0 KiB
Makefile
40 lines
1.0 KiB
Makefile
export GO111MODULE := on
|
|
export GOPROXY = https://proxy.golang.org,direct
|
|
|
|
###############################################################################
|
|
# DEPENDENCIES
|
|
###############################################################################
|
|
|
|
# Install all the build and lint dependencies
|
|
setup:
|
|
go mod download
|
|
go generate -v ./...
|
|
go mod tidy
|
|
.PHONY: setup
|
|
|
|
###############################################################################
|
|
# TESTS
|
|
###############################################################################
|
|
|
|
# Run all the tests
|
|
test:
|
|
go test -failfast -race -timeout=5m ./...
|
|
.PHONY: test
|
|
|
|
###############################################################################
|
|
# CODE HEALTH
|
|
###############################################################################
|
|
|
|
# gofumports and gci all go files
|
|
fmt:
|
|
find . -name '*.go' -not -wholename './vendor/*' | while read -r file; do gofumports -w "$$file"; done
|
|
.PHONY: fmt
|
|
|
|
# Run all the linters
|
|
lint:
|
|
golangci-lint run ./...
|
|
.PHONY: lint
|
|
|
|
ci: test lint
|
|
.PHONY: ci
|