2021-11-01 16:23:00 +00:00
|
|
|
.PHONY: all build lint test coverage build-example
|
2021-04-13 18:54:15 +00:00
|
|
|
|
|
|
|
all: build
|
|
|
|
|
2021-08-16 09:48:11 +00:00
|
|
|
deps: lint-install
|
|
|
|
|
2021-04-13 18:54:15 +00:00
|
|
|
build:
|
|
|
|
go build -o build/waku waku.go
|
2021-07-29 12:40:54 +00:00
|
|
|
|
2021-09-27 17:52:56 +00:00
|
|
|
vendor:
|
|
|
|
go mod tidy
|
|
|
|
|
2021-08-16 09:48:11 +00:00
|
|
|
lint-install:
|
|
|
|
curl -sfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | \
|
|
|
|
bash -s -- -b $(shell go env GOPATH)/bin v1.41.1
|
|
|
|
|
2021-07-29 12:40:54 +00:00
|
|
|
lint:
|
|
|
|
@echo "lint"
|
2021-08-13 11:56:09 +00:00
|
|
|
@golangci-lint --exclude=SA1019 run ./... --deadline=5m
|
2021-10-13 12:48:29 +00:00
|
|
|
|
2021-08-13 11:56:09 +00:00
|
|
|
test:
|
|
|
|
go test -v -failfast ./...
|
2021-10-14 09:03:25 +00:00
|
|
|
|
|
|
|
generate:
|
2021-10-15 10:47:23 +00:00
|
|
|
go generate ./waku/v2/protocol/pb/generate.go
|
|
|
|
|
2021-11-01 16:23:00 +00:00
|
|
|
coverage:
|
|
|
|
go test -count 1 -coverprofile=coverage.out ./...
|
|
|
|
go tool cover -html=coverage.out -o=coverage.html
|
|
|
|
|
2021-11-02 13:55:28 +00:00
|
|
|
codeclimate-coverage:
|
|
|
|
CC_TEST_REPORTER_ID=343d0af350b29aaf08d1e5bb4465d0e21df6298a27240acd2434457a9984c74a
|
|
|
|
GIT_COMMIT=$(git log | grep -m1 -oE '[^ ]+$')
|
|
|
|
./coverage/cc-test-reporter before-build;\
|
|
|
|
go test -count 1 -coverprofile coverage/cover.out ./...;\
|
|
|
|
go test -coverprofile coverage/cover.out -json ./... > coverage/coverage.json
|
|
|
|
EXIT_CODE=$$?;\
|
|
|
|
./coverage/cc-test-reporter after-build -t cover --exit-code $$EXIT_CODE || echo “Skipping Code Climate coverage upload”
|
|
|
|
|
2021-10-15 10:47:23 +00:00
|
|
|
# build a docker image for the fleet
|
|
|
|
docker-image: DOCKER_IMAGE_TAG ?= latest
|
|
|
|
docker-image: DOCKER_IMAGE_NAME ?= statusteam/go-waku:$(DOCKER_IMAGE_TAG)
|
|
|
|
docker-image:
|
|
|
|
docker build --tag $(DOCKER_IMAGE_NAME) \
|
|
|
|
--build-arg="GIT_COMMIT=$(shell git rev-parse HEAD)" .
|
2021-11-01 16:23:00 +00:00
|
|
|
|
|
|
|
build-example-basic2:
|
2021-11-02 00:05:55 +00:00
|
|
|
cd examples/basic2 && $(MAKE)
|
2021-11-01 16:23:00 +00:00
|
|
|
|
|
|
|
build-example-chat-2:
|
2021-11-02 00:05:55 +00:00
|
|
|
cd examples/chat2 && $(MAKE)
|
2021-11-01 16:23:00 +00:00
|
|
|
|
|
|
|
build-example-filter2:
|
2021-11-02 00:05:55 +00:00
|
|
|
cd examples/filter2 && $(MAKE)
|
2021-11-01 16:23:00 +00:00
|
|
|
|
2021-11-02 00:05:55 +00:00
|
|
|
build-example: build-example-basic2 build-example-chat-2 build-example-filter2
|