-
Notifications
You must be signed in to change notification settings - Fork 28
Expand file tree
/
Copy pathMakefile
More file actions
47 lines (38 loc) · 1.44 KB
/
Makefile
File metadata and controls
47 lines (38 loc) · 1.44 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
.PHONY: build_examples clean test check fix help integration docs
# Default target
all: check
# Builds all examples
build_examples:
cd examples/feepayer && go build -o ../../bin/feepayer ./cmd
go build -o bin/simple-send ./examples/simple-send
# Cleans all targets
clean:
go clean
rm -rf bin/
rm -f cover.out cover.html coverage.out
# Run unit tests only (excludes integration tests)
test:
go test -race ./pkg/transaction ./pkg/signer ./pkg/client
# Run unit tests with coverage
test-coverage:
go test -race -coverprofile=coverage.out ./pkg/transaction ./pkg/signer ./pkg/client
go tool cover -html=coverage.out -o cover.html
# Run checks as well as unit tests
check:
test -z "$$(gofmt -l .)" || (echo "Code needs formatting. Run 'make fix'" && gofmt -l . && exit 1)
go vet ./...
go test -race ./pkg/transaction ./pkg/signer ./pkg/client
# Formats code and tidies dependencies
fix:
gofmt -s -w .
go mod tidy
cd examples/feepayer && go mod tidy
# Run integration tests only (uses docker-compose tempo node by default)
integration:
@TEMPO_RPC_URL=$${TEMPO_RPC_URL:-http://localhost:8545} go test -run TestIntegration -timeout=5m ./tests
# Start godoc server for viewing documentation
docs:
which godoc > /dev/null || (echo "Installing godoc..." && go install golang.org/x/tools/cmd/godoc@latest)
echo "Documentation available at http://localhost:6060/pkg/github.com/tempoxyz/tempo-go/"
echo "Press Ctrl+C to stop the server"
@godoc -http=:6060