refactor: genetate protobuf (#259)
* refactor: genetate protobuf * make all
This commit is contained in:
@@ -1,3 +1,5 @@
|
|||||||
|
name: CI
|
||||||
|
|
||||||
on:
|
on:
|
||||||
pull_request:
|
pull_request:
|
||||||
types: [opened, synchronize, reopened, ready_for_review]
|
types: [opened, synchronize, reopened, ready_for_review]
|
||||||
@@ -6,8 +8,6 @@ on:
|
|||||||
- main
|
- main
|
||||||
workflow_dispatch:
|
workflow_dispatch:
|
||||||
|
|
||||||
name: CI
|
|
||||||
|
|
||||||
env:
|
env:
|
||||||
RUST_TOOLCHAIN: stable
|
RUST_TOOLCHAIN: stable
|
||||||
|
|
||||||
@@ -29,7 +29,7 @@ jobs:
|
|||||||
- name: Setup Go
|
- name: Setup Go
|
||||||
uses: actions/setup-go@v5
|
uses: actions/setup-go@v5
|
||||||
with:
|
with:
|
||||||
go-version: "1.18.4"
|
go-version: "1.24.3"
|
||||||
- uses: arduino/setup-protoc@v3
|
- uses: arduino/setup-protoc@v3
|
||||||
with:
|
with:
|
||||||
repo-token: ${{ secrets.GITHUB_TOKEN }}
|
repo-token: ${{ secrets.GITHUB_TOKEN }}
|
||||||
@@ -40,10 +40,12 @@ jobs:
|
|||||||
uses: Swatinem/rust-cache@v2
|
uses: Swatinem/rust-cache@v2
|
||||||
- name: Run cargo check
|
- name: Run cargo check
|
||||||
run: cargo check --workspace --all-targets
|
run: cargo check --workspace --all-targets
|
||||||
- name: Check Go protbuf generation
|
- name: Generate protbuf
|
||||||
run: |
|
run: |
|
||||||
make go
|
make all
|
||||||
test $(git status --porcelain=v1 | wc -l) -eq 0 || (echo "Fail: generated go protobuf in github action is different from pushed ones" ; exit 1)
|
- name: Check protobuf generation
|
||||||
|
run: |
|
||||||
|
git diff --quiet || (echo "Fail: generated go protobuf in github action is different from pushed ones, please run 'make all'"; exit 1)
|
||||||
|
|
||||||
proto-fmt:
|
proto-fmt:
|
||||||
name: Protobuf Format
|
name: Protobuf Format
|
||||||
@@ -96,3 +98,4 @@ jobs:
|
|||||||
uses: Swatinem/rust-cache@v2
|
uses: Swatinem/rust-cache@v2
|
||||||
- name: Run cargo clippy
|
- name: Run cargo clippy
|
||||||
run: cargo clippy --workspace --all-targets -- -D warnings -D clippy::print_stdout -D clippy::print_stderr
|
run: cargo clippy --workspace --all-targets -- -D warnings -D clippy::print_stdout -D clippy::print_stderr
|
||||||
|
|
||||||
+2
-11
@@ -2,17 +2,8 @@
|
|||||||
|
|
||||||
set -e
|
set -e
|
||||||
|
|
||||||
|
PROTO_ROOT=./proto
|
||||||
GO_OUTPUT=./go
|
GO_OUTPUT=./go
|
||||||
|
|
||||||
# TODO(zyy17): Can we make the following commands as one command?
|
protoc -I=${PROTO_ROOT} --go_out=paths=source_relative:${GO_OUTPUT} $(find ./proto/ -type f -iname "*.proto")
|
||||||
protoc --go_out=${GO_OUTPUT} --go_opt=paths=source_relative \
|
|
||||||
--go-grpc_out=${GO_OUTPUT} --go-grpc_opt=paths=source_relative \
|
|
||||||
-Iproto proto/greptime/v1/**/*.proto
|
|
||||||
|
|
||||||
protoc --go_out=${GO_OUTPUT} --go_opt=paths=source_relative \
|
|
||||||
--go-grpc_out=${GO_OUTPUT} --go-grpc_opt=paths=source_relative \
|
|
||||||
-Iproto proto/prometheus/**/*.proto
|
|
||||||
|
|
||||||
protoc --go_out=${GO_OUTPUT} --go_opt=paths=source_relative \
|
|
||||||
--go-grpc_out=${GO_OUTPUT} --go-grpc_opt=paths=source_relative \
|
|
||||||
-Iproto proto/substrait_extension/*.proto
|
|
||||||
|
|||||||
Reference in New Issue
Block a user