Browse Source

tools: remove need to install buf (#4605)

* tools: remove need to install buf

- using buf docker image instead of needing devs to install it

Signed-off-by: Marko Baricevic <marbar3778@yahoo.com>

* fix ci for lint and break checking
pull/4576/head
Marko 4 years ago
committed by GitHub
parent
commit
b14c0e579e
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
6 changed files with 21 additions and 39 deletions
  1. +0
    -18
      .circleci/config.yml
  2. +0
    -0
      .github/workflows/linkchecker.yml
  3. +12
    -0
      .github/workflows/proto.yml
  4. +5
    -4
      CONTRIBUTING.md
  5. +4
    -3
      Makefile
  6. +0
    -14
      tools.mk

+ 0
- 18
.circleci/config.yml View File

@ -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


.github/workflows/action.yml → .github/workflows/linkchecker.yml View File


+ 12
- 0
.github/workflows/proto.yml View File

@ -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

+ 5
- 4
CONTRIBUTING.md View File

@ -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.


+ 4
- 3
Makefile View File

@ -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
###############################################################################


+ 0
- 14
tools.mk View File

@ -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"


Loading…
Cancel
Save