-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathMakefile
More file actions
executable file
·56 lines (44 loc) · 1.84 KB
/
Copy pathMakefile
File metadata and controls
executable file
·56 lines (44 loc) · 1.84 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
.PHONY: build build-all docker-run docker-stop format integrationtest run test proto proto-lint
define setup_env
$(eval include $(1))
$(eval export)
endef
proto: proto-lint
@echo "Compiling stubs..."
@docker run --rm --volume "$(shell pwd):/workspace" --workdir /workspace buf generate
# proto-lint: lints protos
proto-lint:
@echo "Linting protos..."
@docker build -q -t buf -f buf.Dockerfile . &> /dev/null
@docker run --rm --volume "$(shell pwd):/workspace" --workdir /workspace buf lint
run:
@echo "Running emulator..."
$(call setup_env, envs/emulator.dev.env)
@go run cmd/emulator.go
test:
@echo "Running unit tests..."
@go test -v $$(go list ./... | grep -v '/test$$') github.com/arkade-os/emulator/pkg/arkade/... github.com/arkade-os/emulator/pkg/client/...
integrationtest:
@echo "Running integration test..."
@go test -v ./test/...
# docker-run: starts docker test environment
docker-run:
@echo "Running dockerized arkd and arkd wallet in test mode on regtest..."
@docker compose -f docker-compose.regtest.yml up --build -d
# docker-stop: tears down docker test environment
docker-stop:
@echo "Stopping dockerized arkd and arkd wallet in test mode on regtest..."
@docker compose -f docker-compose.regtest.yml down -v
build:
@echo "Building emulator..."
@go build -o build/emulator-$(shell go env GOOS)-$(shell go env GOARCH) cmd/emulator.go
build-all:
@echo "Building emulator for all platforms..."
@CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -o build/emulator-linux-amd64 cmd/emulator.go
@CGO_ENABLED=0 GOOS=linux GOARCH=arm64 go build -o build/emulator-linux-arm64 cmd/emulator.go
@CGO_ENABLED=0 GOOS=darwin GOARCH=amd64 go build -o build/emulator-darwin-amd64 cmd/emulator.go
@CGO_ENABLED=0 GOOS=darwin GOARCH=arm64 go build -o build/emulator-darwin-arm64 cmd/emulator.go
lint:
golangci-lint run --fix
format:
@go fmt ./...