-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
80 lines (60 loc) · 2.2 KB
/
Makefile
File metadata and controls
80 lines (60 loc) · 2.2 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
.PHONY: help build run test test-unit test-docker lint fmt fmt-check check devc devc-up devc-down devc-restart devc-reset devc-status devc-logs install dev-skillshare clean
help:
@echo "Common tasks:"
@echo " make build # build binary"
@echo " make run # run binary help"
@echo " make test # all tests"
@echo " make test-unit # unit tests only"
@echo " make test-docker # tests in docker sandbox"
@echo " make lint # go vet"
@echo " make fmt # format Go files"
@echo " make check # fmt-check + lint + test"
@echo " make devc # start devcontainer + enter shell"
@echo " make devc-up # start devcontainer"
@echo " make devc-down # stop devcontainer"
@echo " make devc-restart # restart devcontainer"
@echo " make devc-reset # full reset (remove volumes)"
@echo " make devc-status # show devcontainer status"
@echo " make devc-logs # tail devcontainer logs"
@echo " make clean # remove build artifacts"
@echo " make dev-skillshare # cross-compile Linux binary to ../skillshare/bin/"
build:
mkdir -p bin && go build -o bin/mdproof ./cmd/mdproof
run: build
./bin/mdproof --help
test: build
./scripts/test.sh
test-unit:
./scripts/test.sh --unit
test-docker:
docker compose -f docker-compose.sandbox.yml --profile offline up --build --abort-on-container-exit --exit-code-from sandbox-offline
docker compose -f docker-compose.sandbox.yml --profile offline down
lint:
go vet ./...
fmt:
gofmt -w ./cmd ./internal
fmt-check:
test -z "$$(gofmt -l ./cmd ./internal)"
check: fmt-check lint test
devc:
./scripts/devc.sh up && ./scripts/devc.sh shell
devc-up:
./scripts/devc.sh up
devc-down:
./scripts/devc.sh down
devc-restart:
./scripts/devc.sh restart
devc-reset:
./scripts/devc.sh reset
devc-status:
./scripts/devc.sh status
devc-logs:
./scripts/devc.sh logs
install:
go install ./cmd/mdproof
dev-skillshare:
@mkdir -p ../skillshare/bin
GOOS=linux GOARCH=$$(uname -m | sed 's/x86_64/amd64/' | sed 's/aarch64/arm64/') CGO_ENABLED=0 go build -o ../skillshare/bin/mdproof ./cmd/mdproof
@echo "Installed Linux binary → ../skillshare/bin/mdproof"
clean:
rm -rf bin coverage.out