Skip to content

Commit 4824c94

Browse files
add php action (#78)
* add php action * add php action * add php action * add php action * add php action * add php action * add php action * add php action * add php action * add php action * add php action * add php action
1 parent 29fb85c commit 4824c94

File tree

3 files changed

+46
-3
lines changed

3 files changed

+46
-3
lines changed

.github/workflows/php.yml

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
# For more information see: https://docs.github.com/en/actions/getting-started-with-github-actions
2+
# For more setup-php see: https://github.com/shivammathur/setup-php
3+
# For more setup-php protoc see: https://github.com/shivammathur/setup-php/issues/262
4+
5+
name: PHP
6+
7+
on: [push, pull_request]
8+
9+
jobs:
10+
run:
11+
name: Run
12+
runs-on: ${{ matrix.operating-system }}
13+
strategy:
14+
fail-fast: false
15+
matrix:
16+
operating-system: [ubuntu-20.04]
17+
php-versions: ['7.4']
18+
env:
19+
extensions: xml, opcache, xdebug, pcov, grpc-1.30.0, protobuf-3.12.2
20+
key: cache-v3
21+
22+
steps:
23+
- name: Checkout
24+
uses: actions/checkout@v2
25+
- name: Setup PHP with extensions and custom config
26+
uses: shivammathur/setup-php@v2
27+
with:
28+
php-version: ${{ matrix.php-versions }}
29+
extensions: ${{ env.extensions }}
30+
ini-values: post_max_size=256M, short_open_tag=On, date.timezone=Asia/Shanghai
31+
tools: protoc, grpc_php_plugin
32+
- name: Testing PHP version
33+
run: |
34+
php -v
35+
php -r "if(strpos(phpversion(), '${{ matrix.php-versions }}') === false) {throw new Exception('Wrong PHP version Installed');}"
36+
- name: Test grpc_php_plugin and protoc
37+
run: |
38+
protoc --version
39+
cd php
40+
make generate

README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# GRPC [![NPM](https://github.com/Chatie/grpc/workflows/NPM/badge.svg)](https://github.com/Chatie/grpc/actions?query=workflow%3ANPM) [![PyPI](https://github.com/Chatie/grpc/workflows/PyPI/badge.svg)](https://github.com/Chatie/grpc/actions?query=workflow%3APyPI) [![Go](https://github.com/chatie/grpc/workflows/Go/badge.svg)](https://github.com/chatie/grpc/actions?query=workflow%3AGo) [![Maven](https://github.com/Chatie/grpc/workflows/Maven/badge.svg)](https://github.com/Chatie/grpc/actions?query=workflow%3A%22Maven%22) [![Node.js](https://github.com/Chatie/grpc/workflows/Node.js/badge.svg)](https://github.com/Chatie/grpc/actions?query=workflow%3ANode.js)
1+
# GRPC [![NPM](https://github.com/Chatie/grpc/workflows/NPM/badge.svg)](https://github.com/Chatie/grpc/actions?query=workflow%3ANPM) [![PyPI](https://github.com/Chatie/grpc/workflows/PyPI/badge.svg)](https://github.com/Chatie/grpc/actions?query=workflow%3APyPI) [![Go](https://github.com/chatie/grpc/workflows/Go/badge.svg)](https://github.com/chatie/grpc/actions?query=workflow%3AGo) [![Maven](https://github.com/Chatie/grpc/workflows/Maven/badge.svg)](https://github.com/Chatie/grpc/actions?query=workflow%3A%22Maven%22) [![Node.js](https://github.com/Chatie/grpc/workflows/Node.js/badge.svg)](https://github.com/Chatie/grpc/actions?query=workflow%3ANode.js) [![PHP](https://github.com/Chatie/grpc/workflows/PHP/badge.svg)](https://github.com/Chatie/grpc/actions?query=workflow%3APHP)
22

33
![chatie grpc](https://chatie.io/grpc/images/grpc.png)
44

@@ -8,6 +8,7 @@
88
[![Python 3.7](https://img.shields.io/badge/python-3.7+-blue.svg?label=Python)](https://www.python.org/downloads/release/python-370/)
99
![Go Version](https://img.shields.io/github/go-mod/go-version/wechaty/go-wechaty)
1010
[![Java Version](https://img.shields.io/maven-central/v/io.github.wechaty/grpc?label=Java)](https://mvnrepository.com/artifact/io.github.wechaty/grpc)
11+
[![PHP Version](https://img.shields.io/packagist/v/wechaty/php-grpc)](https://packagist.org/packages/wechaty/php-grpc)
1112

1213
gRPC for Chatie
1314

php/generate.sh

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@ PROTO_BASE_DIR=../proto
66
PROTO_PUPPET_DIR=$PROTO_BASE_DIR/wechaty/puppet
77
PROTO_WECHATY_DIR=$PROTO_BASE_DIR/wechaty
88

9+
# /usr/local/include
10+
911
OUT_WECHATY_DIR=./generated/wechaty
1012
OUT_PUPPET_DIR=$OUT_WECHATY_DIR
1113

@@ -19,13 +21,13 @@ protoc \
1921
-I $PROTO_PUPPET_DIR \
2022
--php_out=$OUT_PUPPET_DIR \
2123
--grpc_out=$OUT_PUPPET_DIR \
22-
--plugin=protoc-gen-grpc=../../grpc-demo/grpc/bins/opt/grpc_php_plugin \
24+
--plugin=protoc-gen-grpc=/usr/local/bin/grpc_php_plugin \
2325
$PROTO_PUPPET_DIR/*.proto
2426

2527
protoc \
2628
-I $PROTO_WECHATY_DIR \
2729
-I $PROTO_PUPPET_DIR \
2830
--php_out=$OUT_WECHATY_DIR \
2931
--grpc_out=$OUT_WECHATY_DIR \
30-
--plugin=protoc-gen-grpc=../../grpc-demo/grpc/bins/opt/grpc_php_plugin \
32+
--plugin=protoc-gen-grpc=/usr/local/bin/grpc_php_plugin \
3133
$PROTO_WECHATY_DIR/*.proto

0 commit comments

Comments
 (0)