Skip to content

Commit 6ad9192

Browse files
authored
Merge branch 'main' into 6_1_nightly_ci
2 parents b65fb4c + f1a8497 commit 6ad9192

File tree

74 files changed

+814
-5221
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

74 files changed

+814
-5221
lines changed

.github/workflows/pull_request.yml

Lines changed: 22 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -26,14 +26,31 @@ jobs:
2626
linux_nightly_6_1_arguments_override: "--explicit-target-dependency-import-check error -Xswiftc -require-explicit-sendable"
2727
linux_nightly_main_arguments_override: "--explicit-target-dependency-import-check error -Xswiftc -require-explicit-sendable"
2828

29-
examples:
29+
construct-examples-matrix:
30+
name: Construct Examples matrix
31+
runs-on: ubuntu-latest
32+
outputs:
33+
examples-matrix: '${{ steps.generate-matrix.outputs.examples-matrix }}'
34+
steps:
35+
- name: Checkout repository
36+
uses: actions/checkout@v4
37+
with:
38+
persist-credentials: false
39+
- id: generate-matrix
40+
run: echo "examples-matrix=$(curl -s https://raw.githubusercontent.com/apple/swift-nio/main/scripts/generate_matrix.sh | bash)" >> "$GITHUB_OUTPUT"
41+
env:
42+
MATRIX_LINUX_5_9_ENABLED: false
43+
MATRIX_LINUX_5_10_ENABLED: false
44+
MATRIX_LINUX_COMMAND: "./dev/build-examples.sh"
45+
MATRIX_LINUX_SETUP_COMMAND: "apt update && apt install -y protobuf-compiler && ./dev/build-examples.sh"
46+
47+
examples-matrix:
3048
name: Examples
31-
uses: apple/swift-nio/.github/workflows/swift_matrix.yml@main
49+
needs: construct-examples-matrix
50+
uses: apple/swift-nio/.github/workflows/swift_test_matrix.yml@main
3251
with:
3352
name: "Examples"
34-
matrix_linux_5_9_enabled: false
35-
matrix_linux_5_10_enabled: false
36-
matrix_linux_command: "./dev/build-examples.sh"
53+
matrix_string: '${{ needs.construct-examples-matrix.outputs.examples-matrix }}'
3754

3855
benchmarks:
3956
name: Benchmarks

Examples/echo/Package.swift

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,9 @@ let package = Package(
2121
name: "echo",
2222
platforms: [.macOS("15.0")],
2323
dependencies: [
24-
.package(url: "https://github.com/grpc/grpc-swift.git", exact: "2.0.0-beta.3"),
25-
.package(url: "https://github.com/grpc/grpc-swift-protobuf.git", exact: "1.0.0-beta.3"),
26-
.package(url: "https://github.com/grpc/grpc-swift-nio-transport.git", exact: "1.0.0-beta.3"),
24+
.package(url: "https://github.com/grpc/grpc-swift.git", exact: "2.0.0-rc.1"),
25+
.package(url: "https://github.com/grpc/grpc-swift-protobuf.git", exact: "1.0.0-rc.1"),
26+
.package(url: "https://github.com/grpc/grpc-swift-nio-transport.git", exact: "1.0.0-rc.1"),
2727
.package(url: "https://github.com/apple/swift-argument-parser.git", from: "1.5.0"),
2828
],
2929
targets: [
@@ -34,6 +34,9 @@ let package = Package(
3434
.product(name: "GRPCNIOTransportHTTP2", package: "grpc-swift-nio-transport"),
3535
.product(name: "GRPCProtobuf", package: "grpc-swift-protobuf"),
3636
.product(name: "ArgumentParser", package: "swift-argument-parser"),
37+
],
38+
plugins: [
39+
.plugin(name: "GRPCProtobufGenerator", package: "grpc-swift-protobuf")
3740
]
3841
)
3942
]

Examples/echo/README.md

Lines changed: 16 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,27 +12,36 @@ the four RPC types.
1212
The tool uses the [SwiftNIO](https://github.com/grpc/grpc-swift-nio-transport)
1313
HTTP/2 transport.
1414

15+
## Prerequisites
16+
17+
You must have the Protocol Buffers compiler (`protoc`) installed. You can find
18+
the instructions for doing this in the [gRPC Swift Protobuf documentation][0].
19+
The `swift` commands below are all prefixed with `PROTOC_PATH=$(which protoc)`,
20+
this is to let the build system know where `protoc` is located so that it can
21+
generate stubs for you. You can read more about it in the [gRPC Swift Protobuf
22+
documentation][1].
23+
1524
## Usage
1625

1726
Build and run the server using the CLI:
1827

1928
```console
20-
$ swift run echo serve
29+
$ PROTOC_PATH=$(which protoc) swift run echo serve
2130
Echo listening on [ipv4]127.0.0.1:1234
2231
```
2332

2433
Use the CLI to make a unary 'Get' request against it:
2534

2635
```console
27-
$ swift run echo get --message "Hello"
36+
$ PROTOC_PATH=$(which protoc) swift run echo get --message "Hello"
2837
get → Hello
2938
get ← Hello
3039
```
3140

3241
Use the CLI to make a bidirectional streaming 'Update' request:
3342

3443
```console
35-
$ swift run echo update --message "Hello World"
44+
$ PROTOC_PATH=$(which protoc) swift run echo update --message "Hello World"
3645
update → Hello
3746
update → World
3847
update ← Hello
@@ -42,5 +51,8 @@ update ← World
4251
Get help with the CLI by running:
4352

4453
```console
45-
$ swift run echo --help
54+
$ PROTOC_PATH=$(which protoc) swift run echo --help
4655
```
56+
57+
[0]: https://swiftpackageindex.com/grpc/grpc-swift-protobuf/documentation/grpcprotobuf/installing-protoc
58+
[1]: https://swiftpackageindex.com/grpc/grpc-swift-protobuf/documentation/grpcprotobuf/generating-stubs

0 commit comments

Comments
 (0)