Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 0 additions & 5 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,6 @@ Install the necessary dependencies:
go get ./...
```

Generate mocks:
```
go generate
```

To run the repo:

```
Expand Down
28 changes: 7 additions & 21 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,33 +2,21 @@
PACKAGE_NAME := github.com/onflow/flow-cli
GOLANG_CROSS_VERSION ?= v1.25.0

# The tag of the current commit, otherwise empty
# Version tag from git (empty if not on a tagged commit)
VERSION := $(shell git describe --tags --abbrev=0 --exact-match 2>/dev/null)
# Name of the cover profile
# Coverage report output file
COVER_PROFILE := coverage.txt
# Disable go sum database lookup for private repos
GOPRIVATE := github.com/dapperlabs/*
# Ensure go bin path is in path (Especially for CI)
GOPATH ?= $(HOME)/go
PATH := $(PATH):$(GOPATH)/bin
# OS
UNAME := $(shell uname)

# Analytics and account tokens (embedded in binary)
MIXPANEL_PROJECT_TOKEN := 3fae49de272be1ceb8cf34119f747073
ACCOUNT_TOKEN := lilico:sF60s3wughJBmNh2

# Output binary path (can be overridden)
BINARY ?= ./cmd/flow/flow

.PHONY: binary
binary: $(BINARY)

.PHONY: install-tools
install-tools:
cd '${GOPATH}'; \
mkdir -p '${GOPATH}'; \
GO111MODULE=on go install github.com/sanderhahn/gozip/cmd/gozip@latest; \
GO111MODULE=on go install github.com/vektra/mockery/v2@v2.53.5;

.PHONY: test
test:
CGO_ENABLED=1 CGO_CFLAGS="-O2 -D__BLST_PORTABLE__ -std=gnu11" GO111MODULE=on go test -coverprofile=$(COVER_PROFILE) $(if $(JSON_OUTPUT),-json,) ./...
Expand All @@ -44,12 +32,10 @@ ifeq ($(COVER), true)
go tool cover -html=$(COVER_PROFILE) -o index.html
# Generate textual summary.
go tool cover -func=$(COVER_PROFILE) | tee cover-summary.txt
# Optionally zip the HTML (if gozip installed) for CI systems expecting an artifact.
if [ -x "$(shell command -v gozip 2>/dev/null)" ]; then gozip -c coverage.zip index.html || true; fi
endif

.PHONY: ci
ci: install-tools generate test coverage
ci: generate test coverage

$(BINARY):
CGO_ENABLED=1 \
Expand Down Expand Up @@ -97,7 +83,7 @@ check-tidy:
go mod tidy

.PHONY: generate
generate: install-tools
generate:
go generate ./...

.PHONY: release
Expand All @@ -110,4 +96,4 @@ release:
-v `pwd`/sysroot:/sysroot \
-w /go/src/$(PACKAGE_NAME) \
ghcr.io/goreleaser/goreleaser-cross:${GOLANG_CROSS_VERSION} \
release --clean
release --clean