Skip to content

Commit

Permalink
bump ignite cli
Browse files Browse the repository at this point in the history
  • Loading branch information
Pantani committed Nov 13, 2024
1 parent 07fc803 commit 7f74327
Show file tree
Hide file tree
Showing 6 changed files with 1,340 additions and 381 deletions.
117 changes: 104 additions & 13 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,21 +1,112 @@
BUILDDIR ?= $(CURDIR)/build
PROJECT_NAME = Faucet
FIND_ARGS := -name '*.go' -type f
PACKAGES=$(shell go list ./...)
VERSION := $(shell echo $(shell git describe --tags 2> /dev/null || echo "dev-$(shell git describe --always)") | sed 's/^v//')
COVER_FILE := coverage.txt
COVER_HTML_FILE := cover.html

all: install
export GO111MODULE = on

$(BUILDDIR)/:
mkdir -p $@
###############################################################################
### Test ###
###############################################################################

BUILD_TARGETS := build install
build: $(BUILDDIR)/
build: BUILD_ARGS=-o=$(BUILDDIR)
## test-unit: Run the unit tests.
test-unit:
@echo Running unit tests...
@VERSION=$(VERSION) go test -mod=readonly -v -timeout 30m $(PACKAGES)

$(BUILD_TARGETS):
go $@ -mod=readonly $(BUILD_FLAGS) $(BUILD_ARGS) ./...
## test-race: Run the unit tests checking for race conditions
test-race:
@echo Running unit tests with race condition reporting...
@VERSION=$(VERSION) go test -mod=readonly -v -race -timeout 30m $(PACKAGES)

test:
go test ./...
## test-cover: Run the unit tests and create a coverage html report
test-cover:
@echo Running unit tests and creating coverage report...
@VERSION=$(VERSION) go test -mod=readonly -v -timeout 30m -coverprofile=$(COVER_FILE) -covermode=atomic $(PACKAGES)
@go tool cover -html=$(COVER_FILE) -o $(COVER_HTML_FILE)
@rm $(COVER_FILE)

## bench: Run the unit tests with benchmarking enabled
bench:
@echo Running unit tests with benchmarking...
@VERSION=$(VERSION) go test -mod=readonly -v -timeout 30m -bench=. $(PACKAGES)

## test: Run unit and integration tests.
test: govet govulncheck test-unit

.PHONY: test test-unit test-race test-cover bench


###############################################################################
### Build ###
###############################################################################

build: go.sum
ifeq ($(OS),Windows_NT)
go build -o build/faucet.exe ./cmd/faucet
else
go build -o build/faucet ./cmd/faucet
endif

build-linux: go.sum
LEDGER_ENABLED=false GOOS=linux GOARCH=amd64 $(MAKE) build

install: go.sum
go install ./cmd/faucet

###############################################################################
### Tools & Dependencies ###
###############################################################################

go-mod-cache: go.sum
@echo "--> Download go modules to local cache"
@go mod download

go.sum: go.mod
@echo "--> Ensure dependencies have not been modified"
@go mod verify
@go mod tidy

clean:
rm -rf $(BUILDDIR)/
rm -rf build/

.PHONY: go-mod-cache clean

###############################################################################
### Development ###
###############################################################################

## govet: Run go vet.
govet:
@echo Running go vet...
@go vet $(shell go list ./...)

## govulncheck: Run govulncheck
govulncheck:
@echo Running govulncheck...
@go run golang.org/x/vuln/cmd/govulncheck ./...

## format: Run gofumpt and goimports.
format:
@echo Formatting...
@go install mvdan.cc/gofumpt
@go install golang.org/x/tools/cmd/goimports
@find . $(FIND_ARGS) | xargs gofumpt -w .
@find . $(FIND_ARGS) | xargs goimports -w -local github.com/ignite/network

## lint: Run Golang CI Lint.
lint:
@echo Running gocilint...
@go install github.com/golangci/golangci-lint/cmd/golangci-lint
@golangci-lint run --out-format=tab --issues-exit-code=0

help: Makefile
@echo
@echo " Choose a command run in "$(PROJECT_NAME)", or just run 'make' for install"
@echo
@sed -n 's/^##//p' $< | column -t -s ':' | sed -e 's/^/ /'
@echo

.PHONY: all $(BUILD_TARGETS) clean
.PHONY: lint format govet govulncheck help
2 changes: 1 addition & 1 deletion cmd/faucet/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package main
import (
"flag"

"github.com/ignite/cli/ignite/pkg/cosmosfaucet"
"github.com/ignite/cli/v28/ignite/pkg/cosmosfaucet"

"github.com/tendermint/faucet/internal/environ"
)
Expand Down
8 changes: 4 additions & 4 deletions cmd/faucet/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,10 @@ import (
sdkmath "cosmossdk.io/math"
log "github.com/sirupsen/logrus"

"github.com/ignite/cli/ignite/pkg/chaincmd"
chaincmdrunner "github.com/ignite/cli/ignite/pkg/chaincmd/runner"
"github.com/ignite/cli/ignite/pkg/cosmosfaucet"
"github.com/ignite/cli/ignite/pkg/cosmosver"
"github.com/ignite/cli/v28/ignite/pkg/chaincmd"
chaincmdrunner "github.com/ignite/cli/v28/ignite/pkg/chaincmd/runner"
"github.com/ignite/cli/v28/ignite/pkg/cosmosfaucet"
"github.com/ignite/cli/v28/ignite/pkg/cosmosver"
)

func main() {
Expand Down
Loading

0 comments on commit 7f74327

Please sign in to comment.