trustwallet-assets/Makefile
Daniel d547fb1473
Move CI scripts logic from assets-go-libs (#16680)
* Move CI scripts logic from assets-go-libs

* Add Makefile, .golangci.yml and lint jobs to workflow

* Fix
2021-12-20 00:39:53 +03:00

28 lines
667 B
Makefile

#! /usr/bin/make -f
# Go related variables.
GOBASE := $(shell pwd)
GOBIN := $(GOBASE)/bin
# Go files.
GOFMT_FILES?=$$(find . -name '*.go' | grep -v vendor)
all: fmt lint test
test:
@echo " > Running unit tests"
GOBIN=$(GOBIN) go test -cover -race -coverprofile=coverage.txt -covermode=atomic -v ./...
fmt:
@echo " > Format all go files"
GOBIN=$(GOBIN) gofmt -w ${GOFMT_FILES}
lint-install:
ifeq (,$(wildcard test -f bin/golangci-lint))
@echo " > Installing golint"
curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s
endif
lint: lint-install
@echo " > Running golint"
bin/golangci-lint run --timeout=2m