-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathMakefile
More file actions
67 lines (51 loc) · 1.83 KB
/
Copy pathMakefile
File metadata and controls
67 lines (51 loc) · 1.83 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
.PHONY: build test lint tidy vuln check install clean help validate-schemas schema corpus dryrun-k8s dryrun-slurm
BINARY := bammm
CMD := ./cmd/bammm
GOFLAGS := -race
LDFLAGS := -s -w -X main.version=$(shell git describe --tags --always --dirty 2>/dev/null || echo dev)
## build: compile the binary into ./bin/bammm
build:
@mkdir -p bin
go build -ldflags "$(LDFLAGS)" -o bin/$(BINARY) $(CMD)
## install: install bammm into $GOPATH/bin
install:
go install -ldflags "$(LDFLAGS)" $(CMD)
## test: run all tests with race detector and coverage
test:
go test $(GOFLAGS) -coverprofile=coverage.out -covermode=atomic ./...
## test-short: run only unit tests (no integration tags)
test-short:
go test $(GOFLAGS) -short ./...
## lint: run golangci-lint
lint:
golangci-lint run --timeout=5m
## tidy: tidy and verify the module graph
tidy:
go mod tidy
go mod verify
## vuln: scan for known vulnerabilities
vuln:
go run golang.org/x/vuln/cmd/govulncheck@latest ./...
## validate-schemas: emit K8s conversions and validate them with kubeconform
validate-schemas:
./scripts/validate-schemas.sh
## schema: regenerate schema/splat.schema.json from the Go types
schema:
go test ./internal/splat/schema -update
## corpus: scrape a scheduler corpus from GitHub (usage: make corpus SCHED=slurm; SCHED=pairs hunts cross-scheduler pairs)
corpus:
uv run scripts/corpus/fetch_corpus.py $(SCHED)
## dryrun-k8s: Tier 3 dry-run of K8s conversions (needs kubectl -> a cluster with operators)
dryrun-k8s:
bash scripts/dryrun/k8s.sh
## dryrun-slurm: Tier 3 dry-run of Slurm output (needs a working slurmctld)
dryrun-slurm:
bash scripts/dryrun/slurm.sh
## check: lint + test (what CI runs)
check: lint test
## clean: remove build artifacts
clean:
rm -rf bin/ coverage.out dist/
## help: list available targets
help:
@grep -E '^## ' Makefile | sed 's/^## //'