Skip to content

Commit e12f80e

Browse files
committed
build with buf
1 parent 4b7fdc9 commit e12f80e

File tree

6 files changed

+97
-24
lines changed

6 files changed

+97
-24
lines changed

.github/workflows/build-backend.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,11 @@ jobs:
2525
override: true
2626
components: rustfmt, clippy
2727

28+
- name: Setup buf
29+
uses: bufbuild/buf-setup-action@v1.34.0
30+
with:
31+
github_token: ${{ secrets.SYNC_TOKEN }}
32+
2833
- name: Install Protoc
2934
uses: arduino/setup-protoc@v3
3035

Cargo.lock

Lines changed: 80 additions & 13 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

proto/Cargo.toml

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,12 @@ name = "run-example-client"
1212
path = "src/examples/run_client.rs"
1313

1414
[dependencies]
15-
prost = "0.13"
16-
prost-types = "0.13"
1715
tokio = { version = "1.38.0", features = ["macros", "rt-multi-thread"] }
18-
tonic = "0.12.0"
16+
tonic = { version= "0.12.0", features = ["prost"] }
17+
prost-types = "0.13"
18+
prost = "0.13"
1919

2020
[build-dependencies]
21-
tonic-build = "0.12"
21+
tonic-buf-build = "*"
22+
tonic-build = "*"
23+
Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,12 @@
11
version: v2
22

33
modules:
4-
- path: .
5-
4+
- path: ./src/definitions
65
lint:
76
use:
87
- DEFAULT
98
enum_zero_value_suffix: _UNSPECIFIED
109
rpc_allow_same_request_response: false
11-
rpc_allow_google_protobuf_empty_requests: false
10+
rpc_allow_google_protobuf_empty_requests: true
1211
rpc_allow_google_protobuf_empty_responses: true
1312
service_suffix: Service

proto/build.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
fn main() -> Result<(), Box<dyn std::error::Error>> {
2-
tonic_build::compile_protos("src/definitions/ollyllm/v1/ollyllm.proto")?;
1+
fn main() -> Result<(), tonic_buf_build::error::TonicBufBuildError> {
2+
tonic_buf_build::compile_from_buf(tonic_build::configure(), None)?;
33
Ok(())
44
}

proto/src/definitions/ollyllm/v1/ollyllm.proto

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@ syntax = "proto3";
33
package ollyllm.v1;
44

55
import "google/protobuf/empty.proto";
6-
import "span_creation.proto";
7-
import "test_execution.proto";
6+
import "src/definitions/ollyllm/v1/span_creation.proto";
7+
import "src/definitions/ollyllm/v1/test_execution.proto";
88

99
service OllyllmService {
1010
rpc QueueTest(TestExecutionRequest) returns (google.protobuf.Empty) {}

0 commit comments

Comments
 (0)