diff --git a/.circleci/config.yml b/.circleci/config.yml index 95a4bd354..3cd01136b 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -14,9 +14,6 @@ executors: - image: tendermintdev/docker-website-deployment environment: AWS_REGION: us-east-1 - protoc: - docker: - - image: tendermintdev/docker-protoc commands: run_test: @@ -75,19 +72,6 @@ jobs: root: "/tmp/bin" paths: - "." - proto-lint: - executor: protoc - steps: - - checkout - - run: - command: make proto-lint - - proto-breakage: - executor: protoc - steps: - - checkout - - run: - command: make proto-check-breaking-ci test_abci_apps: executor: golang @@ -409,8 +393,6 @@ workflows: - test_abci_apps: requires: - setup_dependencies - - proto-breakage - - proto-lint - test_abci_cli: requires: - setup_dependencies diff --git a/.github/workflows/action.yml b/.github/workflows/linkchecker.yml similarity index 100% rename from .github/workflows/action.yml rename to .github/workflows/linkchecker.yml diff --git a/.github/workflows/proto.yml b/.github/workflows/proto.yml new file mode 100644 index 000000000..ddc9ee4c4 --- /dev/null +++ b/.github/workflows/proto.yml @@ -0,0 +1,12 @@ +name: Proto check +on: [pull_request] +jobs: + proto-checks: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@master + - uses: docker-practice/actions-setup-docker@master + - name: lint + run: make proto-lint + - name: check-breakage + run: make proto-check-breaking-ci diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 6e6897ffa..2681b73ae 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -12,7 +12,7 @@ landing changes in master. All work on the code base should be motivated by a [Github Issue](https://github.com/tendermint/tendermint/issues). [Search](https://github.com/tendermint/tendermint/issues?q=is%3Aopen+is%3Aissue+label%3A%22help+wanted%22) -is a good place start when looking for places to contribute. If you +is a good place start when looking for places to contribute. If you would like to work on an issue which already exists, please indicate so by leaving a comment. @@ -49,8 +49,9 @@ maintainers to take a look. ![Contributing flow](./docs/imgs/contributing.png) Each stage of the process is aimed at creating feedback cycles which align contributors and maintainers to make sure: -* Contributors don’t waste their time implementing/proposing features which won’t land in master. -* Maintainers have the necessary context in order to support and review contributions. + +- Contributors don’t waste their time implementing/proposing features which won’t land in master. +- Maintainers have the necessary context in order to support and review contributions. ## Forking @@ -102,7 +103,7 @@ specify exactly the dependency you want to update, eg. We use [Protocol Buffers](https://developers.google.com/protocol-buffers) along with [gogoproto](https://github.com/gogo/protobuf) to generate code for use across Tendermint Core. -For linting and checking breaking changes, we use [buf](https://buf.build/). If you would like to run linting and check if the changes you have made are breaking then you will have to install the needed dependencies with `make buf`. Then the linting cmd will be `make proto-lint` and the breaking changes check will be `make proto-check-breaking`. +For linting and checking breaking changes, we use [buf](https://buf.build/). If you would like to run linting and check if the changes you have made are breaking then you will need to have docker running locally. Then the linting cmd will be `make proto-lint` and the breaking changes check will be `make proto-check-breaking`. To generate new stubs based off of your changes you can run `make proto-gen` after installing `protoc` and gogoproto. diff --git a/Makefile b/Makefile index a5b7db85a..e313ce7a3 100644 --- a/Makefile +++ b/Makefile @@ -5,6 +5,7 @@ BUILD_TAGS?='tendermint' LD_FLAGS = -X github.com/tendermint/tendermint/version.GitCommit=`git rev-parse --short=8 HEAD` -s -w BUILD_FLAGS = -mod=readonly -ldflags "$(LD_FLAGS)" HTTPS_GIT := https://github.com/tendermint/tendermint.git +DOCKER_BUF := docker run -v $(shell pwd):/workspace --workdir /workspace bufbuild/buf all: check build test install .PHONY: all @@ -54,15 +55,15 @@ proto-gen: .PHONY: proto-gen proto-lint: - @buf check lint --error-format=json + @$(DOCKER_BUF) check lint --error-format=json .PHONY: proto-lint proto-check-breaking: - @buf check breaking --against-input ".git#branch=master" + @$(DOCKER_BUF) check breaking --against-input .git#branch=master .PHONY: proto-check-breaking proto-check-breaking-ci: - @buf check breaking --against-input "$(HTTPS_GIT)#branch=master" + @$(DOCKER_BUF) check breaking --against-input $(HTTPS_GIT)#branch=master .PHONY: proto-check-breaking-ci ############################################################################### diff --git a/tools.mk b/tools.mk index 516fc494e..de722ae89 100644 --- a/tools.mk +++ b/tools.mk @@ -38,14 +38,8 @@ mkfile_dir := $(shell cd $(shell dirname $(mkfile_path)); pwd) # Go tools ### -BIN ?= /usr/local/bin -UNAME_S ?= $(shell uname -s) -UNAME_M ?= $(shell uname -m) - TOOLS_DESTDIR ?= $(GOPATH)/bin -BUF_VERSION ?= 0.7.0 - CERTSTRAP = $(TOOLS_DESTDIR)/certstrap PROTOBUF = $(TOOLS_DESTDIR)/protoc GOODMAN = $(TOOLS_DESTDIR)/goodman @@ -77,14 +71,6 @@ $(PROTOBUF): @go get github.com/gogo/protobuf/protoc-gen-gogo@v1.3.1 .PHONY: protobuf -buf: - @echo "Installing buf..." - @curl -sSL \ - "https://github.com/bufbuild/buf/releases/download/v$(BUF_VERSION)/buf-$(UNAME_S)-$(UNAME_M)" \ - -o "$(BIN)/buf" && \ - chmod +x "$(BIN)/buf" -.PHONY: buf - goodman: $(GOODMAN) $(GOODMAN): @echo "Get Goodman"