forked from stellar/stellar-disbursement-platform-backend
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
64 lines (51 loc) · 1.95 KB
/
Makefile
File metadata and controls
64 lines (51 loc) · 1.95 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
# Check if we need to prepend docker command with sudo
SUDO := $(shell docker version >/dev/null 2>&1 || echo "sudo")
# If LABEL is not provided set default value
LABEL ?= $(shell git rev-parse --short HEAD)$(and $(shell git status -s),-dirty-$(shell id -u -n))
# If TAG is not provided set default value
TAG ?= stellar/stellar-disbursement-platform:$(LABEL)
# https://github.com/opencontainers/image-spec/blob/master/annotations.md
BUILD_DATE := $(shell date -u +%FT%TZ)
# Always run these targets (they don't create files named after the target)
.PHONY: docker-build docker-push go-install setup
docker-build:
$(SUDO) docker build -f Dockerfile.development --pull --label org.opencontainers.image.created="$(BUILD_DATE)" -t $(TAG) --build-arg GIT_COMMIT=$(LABEL) .
docker-push:
$(SUDO) docker push $(TAG)
go-install:
go build -o $(GOPATH)/bin/stellar-disbursement-platform -ldflags "-X main.GitCommit=$(LABEL)" .
setup:
go run tools/sdp-setup/main.go
go-test:
@echo ""
@echo "🧪 Running unit tests..."
gotestsum --format-hide-empty-pkg --format pkgname-and-test-fails
@echo "✅ Unit tests completed successfully"
go-lint:
@echo ""
@echo "🔍 Running golangci-lint..."
golangci-lint run
@echo "✅ golangci-lint completed successfully"
go-shadow:
@echo ""
@echo "🌑 Running shadow variable detection..."
shadow ./...
@echo "✅ Shadow check completed successfully"
go-mod:
@echo ""
@echo "📦 Verifying Go modules..."
./gomod.sh
@echo "✅ Module verification completed successfully"
go-deadcode:
@echo ""
@echo "💀 Running dead code detection..."
deadcode -test ./...
@echo "✅ Dead code check completed successfully"
go-exhaustive:
@echo ""
@echo "🔄 Running exhaustive enum checking..."
exhaustive -default-signifies-exhaustive ./...
@echo "✅ Exhaustive check completed successfully"
go-check: go-test go-lint go-shadow go-mod go-deadcode go-exhaustive
@echo ""
@echo "🎉🎉🎉 All Go checks completed successfully! 🎉🎉🎉"