workgroups/Makefile

69 lines
1.3 KiB
Makefile
Raw Normal View History

2022-03-29 11:45:46 +02:00
GO := go
2021-09-24 14:51:35 +02:00
2022-03-29 11:45:46 +02:00
ROOT_DIR := $(shell dirname $(realpath $(firstword $(MAKEFILE_LIST))))
CACHE_DIR := $(ROOT_DIR)/.cache
2021-09-24 14:51:35 +02:00
2022-03-29 11:45:46 +02:00
export GOBIN := $(ROOT_DIR)/.gobin
export PATH := $(GOBIN):$(PATH)
2021-09-24 14:51:35 +02:00
2022-03-29 11:45:46 +02:00
GORELEASER := $(GO) run github.com/goreleaser/goreleaser@v1.7.0
GOLANGCI_LINT := $(GO) run github.com/golangci/golangci-lint/cmd/golangci-lint@v1.45.2
2021-09-24 14:51:35 +02:00
2022-03-29 11:45:46 +02:00
GOTESTSUM := $(GO) run gotest.tools/gotestsum@v1.7.0
2021-09-24 14:51:35 +02:00
2022-03-29 11:45:46 +02:00
GOREADME := $(GO) run github.com/posener/goreadme/cmd/goreadme@v1.4.2
2021-09-27 10:46:34 +02:00
.PHONY: readme
readme:
2022-03-29 11:45:46 +02:00
$(GOREADME) \
2021-09-27 10:46:34 +02:00
-constants \
-credit=false \
-types \
-methods \
-variabless \
> README.md
.PHONY: setup-githooks
setup-githooks:
git config core.hooksPath githooks
2022-03-29 11:45:46 +02:00
.PHONY: test
test:
$(GOTESTSUM) \
--junitfile report.xml \
-- \
-race \
-cover \
-coverprofile=coverage.out \
-tags=integration \
./... \
-timeout=120m
.PHONY: coverage
coverage: test
$(GO) tool cover -html coverage.out
2022-03-29 11:45:46 +02:00
.PHONY: lint
lint:
$(GOLANGCI_LINT) run \
--enable-all \
--disable=godox,varnamelen,exhaustivestruct \
--timeout 10m
.PHONY: tidy
tidy:
$(GO) mod tidy
$(GO) mod vendor
.PHONY: build
build:
$(GORELEASER) build --rm-dist --snapshot
.PHONY: release
release:
$(GORELEASER) release --rm-dist
.PHONY: release-snapshot
release-snapshot:
$(GORELEASER) release --rm-dist --snapshot --skip-publish