-
Notifications
You must be signed in to change notification settings - Fork 173
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ci: add
proto
file comments linter (#733)
Co-authored-by: 庄松涛 <[email protected]>
- Loading branch information
1 parent
c9e000d
commit e19e539
Showing
4 changed files
with
129 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
name: Layotto Env Pipeline 🌊 | ||
|
||
on: | ||
pull_request: | ||
branches: | ||
- main | ||
|
||
jobs: | ||
check: | ||
name: "🍀 Proto Validation" | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Check out code | ||
uses: actions/checkout@v2 | ||
- name: buf-setup | ||
uses: bufbuild/buf-setup-action@v1 | ||
with: | ||
version: '1.6.0' | ||
- name: buf-lint | ||
uses: bufbuild/buf-lint-action@v1 | ||
- name: check it | ||
run: buf lint |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
version: v1 | ||
lint: | ||
use: | ||
- MINIMAL | ||
- COMMENT_ENUM | ||
- COMMENT_ENUM_VALUE | ||
- COMMENT_FIELD | ||
- COMMENT_MESSAGE | ||
- COMMENT_ONEOF | ||
- COMMENT_RPC | ||
- COMMENT_SERVICE |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -24,12 +24,24 @@ proto.gen.doc: | |
|
||
.PHONY: proto.gen.init | ||
proto.gen.init: | ||
go install google.golang.org/protobuf/cmd/[email protected] | ||
go install google.golang.org/grpc/cmd/[email protected] | ||
go install google.golang.org/protobuf/cmd/[email protected] | ||
go install google.golang.org/grpc/cmd/[email protected] | ||
|
||
.PHONY: proto.gen.code | ||
proto.gen.code: | ||
$(DOCKER) build -t layotto/protoc $(ROOT_DIR)/docker/proto && \ | ||
$(DOCKER) run --rm \ | ||
-v $(ROOT_DIR)/spec/proto/runtime/v1:/api/proto \ | ||
layotto/protoc | ||
|
||
.PHONY: proto.comments | ||
proto.comments: | ||
ifeq (,$(shell which buf)) | ||
@echo "===========> Installing buf linter" | ||
@curl -fsSL \ | ||
"https://github.com/bufbuild/buf/releases/download/v1.6.0/buf-$$(uname -s)-$$(uname -m)" \ | ||
-o "$(OUTPUT_DIR)/buf" | ||
@sudo install -m 0755 $(OUTPUT_DIR)/buf /usr/local/bin/buf | ||
endif | ||
@echo "===========> Running buf linter" | ||
buf lint $(ROOT_DIR) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters