Repository navigation
Expand file tree
/
Copy pathMakefile
More file actions
65 lines (50 loc) · 1.68 KB
/
Copy pathMakefile
File metadata and controls
65 lines (50 loc) · 1.68 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
# gh-elm — build and developer tasks.
# Binaries are named `gh-elm` so `gh extension install .` can find them.
BINARY := gh-elm
PKG := github.com/github/gh-elm
VERSION ?= $(shell git describe --tags --always --dirty 2>/dev/null || echo dev)
LDFLAGS := -X main.version=$(VERSION)
.PHONY: build
build: ## Build the ./gh-elm binary
go build -ldflags "$(LDFLAGS)" -o $(BINARY) .
.PHONY: install
install: build ## Build and (re)install as a local gh extension (gh elm ...)
-gh extension remove elm
gh extension install .
.PHONY: test
test: ## Run unit tests
go test -race ./...
.PHONY: test-integration
test-integration: ## Run black-box CLI integration tests
go test -count=1 -tags=integration ./integration/...
.PHONY: vet
vet: ## go vet
go vet ./...
.PHONY: fmt
fmt: ## Format the code
gofmt -w .
.PHONY: tidy
tidy: ## Tidy go.mod/go.sum
go mod tidy
.PHONY: audit
audit: fmt vet lint test test-integration ## Run formatting, lint, unit, and integration checks
.PHONY: kitchen-sink
kitchen-sink: ## Preview all migration renderers with forced semantic color
@go run ./cmd/kitchen-sink --color
.PHONY: kitchen-sink-json
kitchen-sink-json: ## Preview the raw JSON used by the kitchen sink
@go run ./cmd/kitchen-sink --json
.PHONY: lint
lint: ## Run golangci-lint
script/lint-go-code
.PHONY: release-snapshot
release-snapshot: ## Build a local GoReleaser snapshot into dist/ (no publish)
goreleaser release --snapshot --clean --skip=publish
.PHONY: clean
clean: ## Remove build artifacts
rm -f $(BINARY)
rm -rf dist
.PHONY: help
help: ## Show this help
@grep -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | \
awk 'BEGIN {FS = ":.*?## "}; {printf " \033[36m%-12s\033[0m %s\n", $$1, $$2}'