-
Notifications
You must be signed in to change notification settings - Fork 3
/
Makefile
65 lines (51 loc) · 1.94 KB
/
Makefile
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
.PHONY: docker docker-itest docker-test docker-test-all docker-check docker-shell itest test test-all
IMG_NAME := lndsigner-builder
CPLATFORM := $(shell uname -m)
ifeq ($(CPLATFORM), x86_64)
GOPLATFORM := amd64
endif
ifeq ($(CPLATFORM), aarch64)
GOPLATFORM := arm64
endif
ifeq ($(CPLATFORM), arm64)
GOPLATFORM := arm64
CPLATFORM := aarch64
endif
GOVER := 1.20.3
LND := v0.16.2-beta
BITCOIND := 24.0.1
VAULT := 1.12.2
# docker builds a builder image for the host platform if one isn't cached.
docker:
docker build -t $(IMG_NAME):latest --build-arg cplatform=$(CPLATFORM) \
--build-arg goplatform=$(GOPLATFORM) --build-arg gover=$(GOVER) \
--build-arg lnd=$(LND) --build-arg bitcoind=$(BITCOIND) \
--build-arg vault=$(VAULT) -f Dockerfile.dev .
# docker-itest runs itests in a docker container, then removes the container.
docker-itest: docker
docker run -t --rm \
--mount type=bind,source=$(CURDIR),target=/app $(IMG_NAME):latest \
make itest
# docker-test runs unit tests in a docker container, then removes the container.
docker-test: docker
docker run -t --rm \
--mount type=bind,source=$(CURDIR),target=/app $(IMG_NAME):latest \
make test
# docker-test-all runs unit and integration tests in a docker container, then
# removes the container.
docker-test-all: docker
docker run -t --rm \
--mount type=bind,source=$(CURDIR),target=/app $(IMG_NAME):latest \
make test-all
# docker-shell opens a shell to a dockerized environment with all dependencies
# and also dlv installed for easy debugging, then removes the container.
docker-shell: docker
docker run -it --rm \
--mount type=bind,source=$(CURDIR),target=/app $(IMG_NAME):latest \
bash -l
itest:
go install -race -buildvcs=false ./cmd/... && go test -v -count=1 -race -tags=itest -cover ./itest
test:
go test -v -count=1 -race -cover ./...
test-all:
go install -race -buildvcs=false ./cmd/... && go test -v -count=1 -race -tags=itest -cover ./...