-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
46 lines (35 loc) · 968 Bytes
/
Makefile
File metadata and controls
46 lines (35 loc) · 968 Bytes
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
.PHONY: build test clean install lint
BINARY_NAME=hma-cli
VERSION?=0.1.0
LDFLAGS=-ldflags "-X main.Version=$(VERSION)"
# Build the binary
build:
go build $(LDFLAGS) -o $(BINARY_NAME) ./cmd/hma-cli
# Build for Linux (for deployment to EKS nodes)
build-linux:
GOOS=linux GOARCH=amd64 go build $(LDFLAGS) -o $(BINARY_NAME)-linux-amd64 ./cmd/hma-cli
GOOS=linux GOARCH=arm64 go build $(LDFLAGS) -o $(BINARY_NAME)-linux-arm64 ./cmd/hma-cli
# Run all tests
test:
go test ./... -v
# Run tests with coverage
test-coverage:
go test ./... -coverprofile=coverage.out
go tool cover -html=coverage.out -o coverage.html
# Clean build artifacts
clean:
rm -f $(BINARY_NAME) $(BINARY_NAME)-linux-* coverage.out coverage.html
# Install to $GOPATH/bin
install:
go install ./cmd/hma-cli
# Tidy dependencies
tidy:
go mod tidy
# Run linter (requires golangci-lint)
lint:
golangci-lint run
# Format code
fmt:
go fmt ./...
# All checks before commit
check: fmt lint test