-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathMakefile
More file actions
48 lines (37 loc) · 1.23 KB
/
Makefile
File metadata and controls
48 lines (37 loc) · 1.23 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
.PHONY: build test lint tidy check all build-cfl build-jtk test-shared lint-shared install-hooks
# CI gate: everything that must pass before merge
check: tidy lint test build
all: check
# Build all binaries into bin/
build:
go build -v -o bin/cfl ./tools/cfl/cmd/cfl
go build -v -o bin/jtk ./tools/jtk/cmd/jtk
# Run tests with race detector
test:
go test -race ./shared/...
go test -race ./tools/cfl/...
go test -race ./tools/jtk/...
# Lint with golangci-lint (config in each module's .golangci.yml)
lint:
cd shared && golangci-lint run
cd tools/cfl && golangci-lint run
cd tools/jtk && golangci-lint run
# Tidy and verify modules are clean
tidy:
cd shared && go mod tidy
cd tools/cfl && go mod tidy
cd tools/jtk && go mod tidy
git diff --exit-code shared/go.mod shared/go.sum tools/cfl/go.mod tools/cfl/go.sum tools/jtk/go.mod tools/jtk/go.sum
# Build individual tools to bin/
build-cfl:
go build -v -o bin/cfl ./tools/cfl/cmd/cfl
build-jtk:
go build -v -o bin/jtk ./tools/jtk/cmd/jtk
test-shared:
go test -v -race -coverprofile=coverage-shared.out ./shared/...
lint-shared:
cd shared && golangci-lint run
install-hooks:
cp hooks/pre-commit .git/hooks/pre-commit
chmod +x .git/hooks/pre-commit
@echo "Pre-commit hook installed."