Skip to content

Commit d982caf

Browse files
committed
chore: Pre-generate protobuf library
1 parent a615c10 commit d982caf

File tree

20 files changed

+997
-6
lines changed

20 files changed

+997
-6
lines changed

.github/workflows/build.yml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,6 @@ jobs:
6060
extensions: sockets, curl, zip, ffi, grpc
6161
php-version: ${{ matrix.php }}
6262
coverage: none
63-
tools: protoc, grpc_php_plugin
6463
env:
6564
fail-fast: true
6665
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
@@ -143,4 +142,4 @@ jobs:
143142
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
144143
name: Checkout repository
145144
- name: run musl # If shared-mime-info not installed - Expected binary contents to have content type 'image/jpeg' but detected contents was 'application/octet-stream'
146-
run: docker run --env PACT_DO_NOT_TRACK=true --env GRPC_PHP_PLUGIN_PATH=/usr/bin/grpc_php_plugin --rm -v $PWD:/home alpine:3.19 /bin/sh -c 'apk add --no-cache shared-mime-info php82-dev php82-ffi php82-pecl-grpc php82-sockets php82-tokenizer php82-dom php82-xml php82-xmlwriter php82-simplexml composer protoc grpc && cd /home && composer install && composer test && composer run-examples'
145+
run: docker run --env PACT_DO_NOT_TRACK=true --rm -v $PWD:/home alpine:3.19 /bin/sh -c 'apk add --no-cache shared-mime-info php82-dev php82-ffi php82-pecl-grpc php82-sockets php82-tokenizer php82-dom php82-xml php82-xmlwriter php82-simplexml composer && cd /home && composer install && composer test && composer run-examples'

composer.json

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,10 @@
6767
"test-coverage": "phpunit",
6868
"check-compatibility": "behat",
6969
"refactor": "rector",
70+
"generate-protobuf": [
71+
"protoc --php_out=example/protobuf-async-message/library/src example/protobuf-async-message/library/proto/say_hello.proto",
72+
"protoc --php_out=example/protobuf-sync-message/library/src --grpc_out=generate_server:example/protobuf-sync-message/library/src --plugin=protoc-gen-grpc=$(which grpc_php_plugin) example/protobuf-sync-message/library/proto/area_calculator.proto"
73+
],
7074
"run-examples": [
7175
"composer run-example:binary",
7276
"composer run-example:csv",
@@ -119,13 +123,11 @@
119123
],
120124
"run-example:protobuf-async-message": [
121125
"rm -f example/protobuf-async-message/pacts/protobufAsyncMessageConsumer-protobufAsyncMessageProvider.json",
122-
"protoc --php_out=example/protobuf-async-message/library/src example/protobuf-async-message/library/proto/say_hello.proto",
123126
"cd example/protobuf-async-message/consumer && phpunit",
124127
"cd example/protobuf-async-message/provider && phpunit"
125128
],
126129
"run-example:protobuf-sync-message": [
127130
"rm -f example/protobuf-sync-message/pacts/protobufSyncMessageConsumer-protobufSyncMessageProvider.json",
128-
"protoc --php_out=example/protobuf-sync-message/library/src --grpc_out=generate_server:example/protobuf-sync-message/library/src --plugin=protoc-gen-grpc=$GRPC_PHP_PLUGIN_PATH example/protobuf-sync-message/library/proto/area_calculator.proto",
129131
"cd example/protobuf-sync-message/consumer && phpunit",
130132
"cd example/protobuf-sync-message/provider && phpunit"
131133
],

example/protobuf-async-message/library/src/.gitignore

Lines changed: 0 additions & 1 deletion
This file was deleted.

example/protobuf-async-message/library/src/GPBMetadata/Example/ProtobufAsyncMessage/Library/Proto/SayHello.php

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

example/protobuf-async-message/library/src/Library/Name.php

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

example/protobuf-async-message/library/src/Library/Person.php

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

example/protobuf-sync-message/library/src/.gitignore

Lines changed: 0 additions & 1 deletion
This file was deleted.

example/protobuf-sync-message/library/src/GPBMetadata/Example/Library/Proto/AreaCalculator.php

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

example/protobuf-sync-message/library/src/GPBMetadata/Example/SyncMessage/Library/Proto/AreaCalculator.php

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

example/protobuf-sync-message/library/src/Plugins/AreaResponse.php

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

0 commit comments

Comments
 (0)