-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
35 lines (26 loc) · 1021 Bytes
/
Makefile
File metadata and controls
35 lines (26 loc) · 1021 Bytes
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
.PHONY: lint test coverage integration build all clean security
BINARY := bin/substrate-bootstrap
COVERAGE_FILE := coverage.out
COVERAGE_THRESHOLD := 80
lint:
golangci-lint run
test:
go test ./cmd/... -race -timeout=60s
go test ./internal/... -race -coverprofile=$(COVERAGE_FILE) -covermode=atomic -timeout=60s
coverage: test
@total=$$(go tool cover -func=$(COVERAGE_FILE) | grep total | awk '{print $$3}' | tr -d '%'); \
echo "Total coverage: $${total}%"; \
if [ $$(echo "$${total} < $(COVERAGE_THRESHOLD)" | bc -l) -eq 1 ]; then \
echo "FAIL: coverage $${total}% is below threshold $(COVERAGE_THRESHOLD)%"; \
exit 1; \
fi
integration:
go test ./tests/supervisor/ -v -tags=integration -count=1 -timeout=180s
build:
./scripts/build.sh
all: lint test coverage integration build
# Full module scan (including tests/e2e mock_node); run via `make security` / CI security job.
security:
go run github.com/securego/gosec/v2/cmd/gosec@v2.25.0 -exclude-generated ./...
clean:
rm -rf bin/ $(COVERAGE_FILE)