-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
65 lines (50 loc) · 1.57 KB
/
Makefile
File metadata and controls
65 lines (50 loc) · 1.57 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
BINARY := inngest
CMD := ./cmd/inngest
BUILD_DIR := ./build
VERSION ?= $(shell git describe --tags --always --dirty 2>/dev/null || echo "dev")
LDFLAGS := -ldflags "-s -w \
-X main.version=$(VERSION)"
.PHONY: build install clean tidy run test lint fmt vet check help release
## help: Show available make targets
help:
@echo "Usage: make <target>"
@sed -n 's/^## //p' $(MAKEFILE_LIST) | column -t -s ':' | sed -e 's/^/ /'
## build: Build binary to ./build/inngest
build:
@mkdir -p $(BUILD_DIR)
go build -trimpath $(LDFLAGS) -o $(BUILD_DIR)/$(BINARY) $(CMD)
## install: Install binary to GOPATH/bin
install:
go install $(LDFLAGS) $(CMD)
## run: Run without installing (ARGS="..." to pass arguments)
run:
go run $(LDFLAGS) $(CMD) $(ARGS)
## tidy: Tidy and verify go modules
tidy:
go mod tidy
go mod verify
## test: Run all tests with race detector and coverage
test:
go test -v -race -coverprofile=coverage.out ./...
## coverage: Open test coverage report in browser
coverage: test
go tool cover -html=coverage.out
## fmt: Format all Go source files
fmt:
go fmt ./...
## vet: Run go vet
vet:
go vet ./...
## lint: Run golangci-lint (installs if missing)
lint:
@which golangci-lint > /dev/null 2>&1 || go install github.com/golangci/golangci-lint/v2/cmd/golangci-lint@v2.11.3
golangci-lint run ./...
## check: Run fmt, vet, and lint (pre-commit gate)
check: fmt vet lint
## release: Build release binaries for all platforms
release:
@chmod +x scripts/release.sh
@./scripts/release.sh $(VERSION)
## clean: Remove build artifacts
clean:
rm -rf $(BUILD_DIR) dist coverage.out