-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
62 lines (49 loc) · 1.73 KB
/
Makefile
File metadata and controls
62 lines (49 loc) · 1.73 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
SHELL := /bin/bash
# This Makefile operates on the framework module only.
# Each example under examples/* ships its own Makefile / npm scripts.
NO_ROOT_IMPORT_CHECK := go run ./scripts/check-no-root-imports.go
COVERAGE_PROFILE := coverage.out
COVERAGE_GATE := go run ./scripts/coverage-gate
.PHONY: test lint lint-go lint-ci vet ci examples coverage coverage-gate verify
test:
go test ./...
vet:
go vet ./...
lint:
go test ./...
$(NO_ROOT_IMPORT_CHECK)
# lint-go runs golangci-lint. Requires golangci-lint v2.4+ (Go 1.25 support):
# go install github.com/golangci/golangci-lint/v2/cmd/golangci-lint@v2.11.4
# CI pins v2.11 via golangci/golangci-lint-action@v9 — keep these in sync.
lint-go:
golangci-lint run ./...
lint-ci:
$(MAKE) lint
$(MAKE) vet
# coverage runs the test suite for pkg/ with a coverage profile. The
# profile is consumed by coverage-gate (see below) and can also be
# inspected manually with `go tool cover -html=coverage.out`.
coverage:
go test -covermode=atomic -coverprofile=$(COVERAGE_PROFILE) ./pkg/...
# coverage-gate fails the build when any tracked package drops below
# its declared threshold (see scripts/coverage-gate/main.go).
# Security-critical packages (pkg/auth, pkg/web/security) and pkg/core
# get the tightest bars.
coverage-gate: coverage
$(COVERAGE_GATE) -profile=$(COVERAGE_PROFILE)
ci:
$(MAKE) lint-ci
$(MAKE) coverage-gate
# Build every example. Useful as a smoke test for the framework API surface.
examples:
@for example in examples/*/; do \
if [ -f "$${example}go.mod" ]; then \
echo "==> building $${example}"; \
(cd "$${example}" && go build ./...) || exit 1; \
fi; \
done
verify:
go build ./pkg/...
templ generate ./examples/...
go build ./examples/...
go test ./pkg/web/...