diff --git a/.github/workflows/sims.yaml b/.github/workflows/sims.yaml index f1028a2be..1c729db1b 100644 --- a/.github/workflows/sims.yaml +++ b/.github/workflows/sims.yaml @@ -1,18 +1,18 @@ -name: Simulation Test -on: [pull_request] +# name: Simulation Test +# on: [pull_request] -jobs: - test-sim-nondeterminism-fast: - name: Test AppStateDeterminism - runs-on: ubuntu-latest - steps: - - name: Checkout source code - uses: actions/checkout@v3 - - name: Setup go - uses: actions/setup-go@v3 - with: - go-version: '^1.19' # The Go version to download (if necessary) and use. - - run: make test-sim-nondeterminism-fast +# jobs: +# test-sim-nondeterminism-fast: +# name: Test AppStateDeterminism +# runs-on: ubuntu-latest +# steps: +# - name: Checkout source code +# uses: actions/checkout@v3 +# - name: Setup go +# uses: actions/setup-go@v3 +# with: +# go-version: '^1.19' # The Go version to download (if necessary) and use. +# - run: make test-sim-nondeterminism-fast # test-sim-import-export: # name: Test AppImportExport # runs-on: ubuntu-latest diff --git a/Makefile b/Makefile index 2890af169..53b07aa32 100644 --- a/Makefile +++ b/Makefile @@ -1,9 +1,9 @@ #!/usr/bin/make -f -# The below include contains the tools. -include contrib/devtools/Makefile + +include scripts/build/contract.mk include scripts/build/protobuf.mk include scripts/build/testing.mk include scripts/build/linting.mk -include scripts/build/contract.mk + diff --git a/contrib/devtools/Makefile b/contrib/devtools/Makefile deleted file mode 100644 index f8a5de4ed..000000000 --- a/contrib/devtools/Makefile +++ /dev/null @@ -1,76 +0,0 @@ -### -# Find OS and Go environment -# GO contains the Go binary -# FS contains the OS file separator -### -ifeq ($(OS),Windows_NT) - GO := $(shell where go.exe 2> NUL) - FS := "\\" -else - GO := $(shell command -v go 2> /dev/null) - FS := "/" -endif - -ifeq ($(GO),) - $(error could not find go. Is it in PATH? $(GO)) -endif - -############################################################################### -### Functions ### -############################################################################### - -go_get = $(if $(findstring Windows_NT,$(OS)),\ -IF NOT EXIST $(GITHUBDIR)$(FS)$(1)$(FS) ( mkdir $(GITHUBDIR)$(FS)$(1) ) else (cd .) &\ -IF NOT EXIST $(GITHUBDIR)$(FS)$(1)$(FS)$(2)$(FS) ( cd $(GITHUBDIR)$(FS)$(1) && git clone https://github.com/$(1)/$(2) ) else (cd .) &\ -,\ -mkdir -p $(GITHUBDIR)$(FS)$(1) &&\ -(test ! -d $(GITHUBDIR)$(FS)$(1)$(FS)$(2) && cd $(GITHUBDIR)$(FS)$(1) && git clone https://github.com/$(1)/$(2)) || true &&\ -)\ -cd $(GITHUBDIR)$(FS)$(1)$(FS)$(2) && git fetch origin && git checkout -q $(3) - -mkfile_path := $(abspath $(lastword $(MAKEFILE_LIST))) -mkfile_dir := $(shell cd $(shell dirname $(mkfile_path)); pwd) - - -############################################################################### -### Tools ### -############################################################################### - -PREFIX ?= /usr/local -BIN ?= $(PREFIX)/bin -UNAME_S ?= $(shell uname -s) -UNAME_M ?= $(shell uname -m) - -GOPATH ?= $(shell $(GO) env GOPATH) -GITHUBDIR := $(GOPATH)$(FS)src$(FS)github.com - -BUF_VERSION ?= 0.11.0 - -TOOLS_DESTDIR ?= $(GOPATH)/bin -STATIK = $(TOOLS_DESTDIR)/statik -RUNSIM = $(TOOLS_DESTDIR)/runsim - -tools: tools-stamp -tools-stamp: statik runsim - # Create dummy file to satisfy dependency and avoid - # rebuilding when this Makefile target is hit twice - # in a row. - touch $@ - -# Install the runsim binary -statik: $(STATIK) -$(STATIK): - @echo "Installing statik..." - @go install github.com/rakyll/statik@v0.1.6 - -# Install the runsim binary -runsim: $(RUNSIM) -$(RUNSIM): - @echo "Installing runsim..." - @go install github.com/cosmos/tools/cmd/runsim@v1.0.0 - -tools-clean: - rm -f $(STATIK) $(GOLANGCI_LINT) $(RUNSIM) - rm -f tools-stamp - -.PHONY: tools-clean statik runsim \ No newline at end of file diff --git a/contrib/devtools/install-golangci-lint.sh b/contrib/devtools/install-golangci-lint.sh deleted file mode 100644 index 6b2676c65..000000000 --- a/contrib/devtools/install-golangci-lint.sh +++ /dev/null @@ -1,33 +0,0 @@ -#!/bin/bash - -set -euo pipefail - -installer="$(mktemp)" -trap "rm -f ${installer}" EXIT - -GOBIN="${1}" -CURL="$(which curl)" -HASHSUM="${2}" - -f_sha256() { - local l_file - l_file=$1 - python -sBc "import hashlib;print(hashlib.sha256(open('$l_file','rb').read()).hexdigest())" -} - -get_latest_release() { - "${CURL}" --silent "https://api.github.com/repos/$1/releases/latest" | - grep '"tag_name":' | sed -E 's/.*"([^"]+)".*/\1/' -} - -VERSION="$(get_latest_release golangci/golangci-lint)" - -echo "Downloading golangci-lint ${VERSION} installer ..." >&2 -"${CURL}" -sfL "https://raw.githubusercontent.com/golangci/golangci-lint/${VERSION}/install.sh" >"${installer}" - -echo "Checking hashsum ..." >&2 -# [ "${HASHSUM}" = "$(f_sha256 ${installer})" ] -chmod +x "${installer}" - -echo "Launching installer ..." >&2 -exec "${installer}" -d -b "${GOBIN}" "${VERSION}" diff --git a/scripts/Makefile b/scripts/Makefile deleted file mode 100644 index aed8b0a36..000000000 --- a/scripts/Makefile +++ /dev/null @@ -1,152 +0,0 @@ -all: get_tools - - -######################################## - -GOLINT = github.com/tendermint/lint/golint -GOMETALINTER = gopkg.in/alecthomas/gometalinter.v2 -UNCONVERT = github.com/mdempsky/unconvert -INEFFASSIGN = github.com/gordonklaus/ineffassign -MISSPELL = github.com/client9/misspell/cmd/misspell -ERRCHECK = github.com/kisielk/errcheck -UNPARAM = mvdan.cc/unparam -STATIK = github.com/rakyll/statik - -GOLINT_CHECK := $(shell command -v golint 2> /dev/null) -GOMETALINTER_CHECK := $(shell command -v gometalinter.v2 2> /dev/null) -UNCONVERT_CHECK := $(shell command -v unconvert 2> /dev/null) -INEFFASSIGN_CHECK := $(shell command -v ineffassign 2> /dev/null) -MISSPELL_CHECK := $(shell command -v misspell 2> /dev/null) -ERRCHECK_CHECK := $(shell command -v errcheck 2> /dev/null) -UNPARAM_CHECK := $(shell command -v unparam 2> /dev/null) -STATIK_CHECK := $(shell command -v statik 2> /dev/null) - - -check_tools: -ifndef STATIK_CHECK - @echo "No statik in path. Install with 'make get_tools'." -else - @echo "Found statik in path." -endif - -check_dev_tools: - $(MAKE) check_tools -ifndef GOLINT_CHECK - @echo "No golint in path. Install with 'make get_dev_tools'." -else - @echo "Found golint in path." -endif -ifndef GOMETALINTER_CHECK - @echo "No gometalinter in path. Install with 'make get_dev_tools'." -else - @echo "Found gometalinter in path." -endif -ifndef UNCONVERT_CHECK - @echo "No unconvert in path. Install with 'make get_dev_tools'." -else - @echo "Found unconvert in path." -endif -ifndef INEFFASSIGN_CHECK - @echo "No ineffassign in path. Install with 'make get_dev_tools'." -else - @echo "Found ineffassign in path." -endif -ifndef MISSPELL_CHECK - @echo "No misspell in path. Install with 'make get_dev_tools'." -else - @echo "Found misspell in path." -endif -ifndef ERRCHECK_CHECK - @echo "No errcheck in path. Install with 'make get_dev_tools'." -else - @echo "Found errcheck in path." -endif -ifndef UNPARAM_CHECK - @echo "No unparam in path. Install with 'make get_dev_tools'." -else - @echo "Found unparam in path." -endif - -get_tools: -ifdef STATIK_CHECK - @echo "Statik is already installed. Run 'make update_tools' to update." -else - @echo "Installing statik" - go version - go get -v $(STATIK) -endif - -get_dev_tools: - $(MAKE) get_tools -ifdef GOLINT_CHECK - @echo "Golint is already installed. Run 'make update_tools' to update." -else - @echo "Installing golint" - go get -v $(GOLINT) -endif -ifdef GOMETALINTER_CHECK - @echo "Gometalinter.v2 is already installed. Run 'make update_tools' to update." -else - @echo "Installing gometalinter.v2" - go get -v $(GOMETALINTER) -endif -ifdef UNCONVERT_CHECK - @echo "Unconvert is already installed. Run 'make update_tools' to update." -else - @echo "Installing unconvert" - go get -v $(UNCONVERT) -endif -ifdef INEFFASSIGN_CHECK - @echo "Ineffassign is already installed. Run 'make update_tools' to update." -else - @echo "Installing ineffassign" - go get -v $(INEFFASSIGN) -endif -ifdef MISSPELL_CHECK - @echo "misspell is already installed. Run 'make update_tools' to update." -else - @echo "Installing misspell" - go get -v $(MISSPELL) -endif -ifdef ERRCHECK_CHECK - @echo "errcheck is already installed. Run 'make update_tools' to update." -else - @echo "Installing errcheck" - go get -v $(ERRCHECK) -endif -ifdef UNPARAM_CHECK - @echo "unparam is already installed. Run 'make update_tools' to update." -else - @echo "Installing unparam" - go get -v $(UNPARAM) -endif -ifdef STATIK_CHECK - @echo "statik is already installed. Run 'make update_tools' to update." -else - @echo "Installing statik" - go get -v $(STATIK) -endif - -update_dev_tools: - $(MAKE) update_tools - @echo "Updating tendermint/golint" - go get -u -v $(GOLINT) - @echo "Updating gometalinter.v2" - go get -u -v $(GOMETALINTER) - @echo "Updating unconvert" - go get -u -v $(UNCONVERT) - @echo "Updating ineffassign" - go get -u -v $(INEFFASSIGN) - @echo "Updating misspell" - go get -u -v $(MISSPELL) - @echo "Updating errcheck" - go get -u -v $(ERRCHECK) - @echo "Updating unparam" - go get -u -v $(UNPARAM) - @echo "Updating statik" - go get -u -v $(STATIK) - -# To avoid unintended conflicts with file names, always add to .PHONY -# unless there is a reason not to. -# https://www.gnu.org/software/make/manual/html_node/Phony-Targets.html -.PHONY: check_tools get_tools update_tools check_dev_tools get_dev_tools update_dev_tools \ No newline at end of file