1
2# Exporting bin folder to the path for makefile
3export PATH := $(PWD)/bin:$(PATH)
4# Default Shell
5export SHELL := bash
6# Type of OS: Linux or Darwin.
7export OSTYPE := $(shell uname -s)
8
9ifeq ($(OSTYPE),Darwin)
10 export MallocNanoZone=0
11endif
12
13include ./misc/makefile/tools.Makefile
14
15build: test
16 @go build ./...
17
18install-deps: gotestsum tparse ## Install Development Dependencies (localy).
19deps: $(GOTESTSUM) $(TPARSE) ## Checks for Global Development Dependencies.
20deps:
21 @echo "Required Tools Are Available"
22
23TESTS_ARGS := --format testname --jsonfile gotestsum.json.out
24TESTS_ARGS += --max-fails 2
25TESTS_ARGS += -- ./...
26TESTS_ARGS += -test.parallel 2
27TESTS_ARGS += -test.count 1
28TESTS_ARGS += -test.failfast
29TESTS_ARGS += -test.coverprofile coverage.out
30TESTS_ARGS += -test.timeout 60s
31TESTS_ARGS += -race
32run-tests: $(GOTESTSUM)
33 @ gotestsum $(TESTS_ARGS) -short
34
35test: run-tests $(TPARSE) ## Run Tests & parse details
36 @cat gotestsum.json.out | $(TPARSE) -all -notests
37
38
39lint: $(GOLANGCI) ## Runs golangci-lint with predefined configuration
40 @echo "Applying linter"
41 golangci-lint version
42 golangci-lint run -c .golangci.yaml ./...
43
44.PHONY: lint lint-prepare clean build unittest