Skip to content

Commit feef319

Browse files
committed
Test building packaged PHP extension
1 parent 3be07ab commit feef319

File tree

1 file changed

+43
-0
lines changed

1 file changed

+43
-0
lines changed

.github/workflows/php-ext.yml

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
name: PHP extension
2+
3+
on:
4+
- push
5+
- pull_request
6+
7+
jobs:
8+
build-php:
9+
name: Build PHP extension
10+
runs-on: ubuntu-latest
11+
container: ${{ matrix.php-image }}
12+
strategy:
13+
matrix:
14+
php-image:
15+
- php:7.4-cli
16+
- php:8.1-cli
17+
steps:
18+
- name: Install git
19+
run: |
20+
apt-get update -q
21+
apt-get install -qy --no-install-recommends git
22+
- name: Checkout
23+
uses: actions/checkout@v3
24+
with:
25+
submodules: recursive
26+
- name: Prepare source code
27+
run: |
28+
rm -rf "$GITHUB_WORKSPACE/php/ext/google/protobuf/third_party"
29+
cp -r "$GITHUB_WORKSPACE/third_party" "$GITHUB_WORKSPACE/php/ext/google/protobuf"
30+
cp "$GITHUB_WORKSPACE/LICENSE" "$GITHUB_WORKSPACE/php/ext/google/protobuf"
31+
- name: Create package
32+
run: |
33+
cd /tmp
34+
rm -rf protobuf-*.tgz
35+
pecl package "$GITHUB_WORKSPACE/php/ext/google/protobuf/package.xml"
36+
- name: Compile extension
37+
run: |
38+
cd /tmp
39+
MAKE="make -j$(nproc)" pecl install protobuf-*.tgz
40+
- name: Enable extension
41+
run: docker-php-ext-enable protobuf
42+
- name: Inspect extension
43+
run: php --ri protobuf

0 commit comments

Comments
 (0)