-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
83 lines (60 loc) · 1.63 KB
/
Makefile
File metadata and controls
83 lines (60 loc) · 1.63 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
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
.PHONY: build vet fmt lint test test-unit test-integration test-e2e test-all clean clean-cache clean-all coverage coverage-atlas
BIN_DIR := bin
BINARY := $(BIN_DIR)/matlas-cli
build:
./scripts/build/build.sh
$(BINARY):
@mkdir -p $(BIN_DIR)
./scripts/build/build.sh build -o $(BINARY)
test:
./scripts/test.sh unit
test-unit:
./scripts/test.sh unit
test-integration:
./scripts/test.sh integration
test-e2e:
./scripts/test.sh e2e
test-all:
./scripts/test.sh all
vet:
go vet ./...
fmt:
go fmt ./...
lint:
golangci-lint run --no-config --enable-only=errcheck,gosec,ineffassign --timeout=5m
test-short:
./scripts/test.sh unit
coverage:
./scripts/test.sh unit --coverage
coverage-atlas:
go clean -testcache
go test -coverprofile=atlas-coverage.out ./internal/atlas/...
@COVERAGE=$$(go tool cover -func=atlas-coverage.out | grep total | awk '{print $$3}' | sed 's/%//'); \
echo "Atlas package coverage: $$COVERAGE%"; \
if [ $$(echo "$$COVERAGE < 90" | bc -l) -eq 1 ]; then \
echo "❌ Coverage below 90% threshold ($$COVERAGE%)"; \
exit 1; \
else \
echo "✅ Coverage meets 90% threshold ($$COVERAGE%)"; \
fi
coverage-ci: coverage-atlas
@echo "CI coverage check passed"
clean:
rm -f bin/matlas-cli
rm -f coverage.out coverage.html atlas-coverage.out
clean-cache:
./scripts/utils/clean.sh cache
clean-all: clean clean-cache
./scripts/utils/clean.sh all
generate-mocks:
./scripts/generate-mocks.sh
install-hooks:
mkdir -p .git/hooks
cp scripts/pre-commit .git/hooks/pre-commit
chmod +x .git/hooks/pre-commit
install:
./install.sh
install-user:
MATLAS_INSTALL_DIR=~/.local/bin ./install.sh
uninstall:
./uninstall.sh