Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix building packaged PHP extension #9727

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
43 changes: 43 additions & 0 deletions .github/workflows/php-ext.yml
@@ -0,0 +1,43 @@
name: PHP extension

on:
- push
- pull_request

jobs:
build-php:
name: Build PHP extension
runs-on: ubuntu-latest
container: ${{ matrix.php-image }}
strategy:
matrix:
php-image:
- php:7.4-cli
- php:8.1-cli
steps:
- name: Install git
run: |
apt-get update -q
apt-get install -qy --no-install-recommends git
- name: Checkout
uses: actions/checkout@v3
with:
submodules: recursive
- name: Prepare source code
run: |
rm -rf "$GITHUB_WORKSPACE/php/ext/google/protobuf/third_party"
cp -r "$GITHUB_WORKSPACE/third_party" "$GITHUB_WORKSPACE/php/ext/google/protobuf"
cp "$GITHUB_WORKSPACE/LICENSE" "$GITHUB_WORKSPACE/php/ext/google/protobuf"
- name: Create package
run: |
cd /tmp
rm -rf protobuf-*.tgz
pecl package "$GITHUB_WORKSPACE/php/ext/google/protobuf/package.xml"
- name: Compile extension
run: |
cd /tmp
MAKE="make -j$(nproc)" pecl install protobuf-*.tgz
- name: Enable extension
run: docker-php-ext-enable protobuf
- name: Inspect extension
run: php --ri protobuf
1 change: 1 addition & 0 deletions php/ext/google/protobuf/config.m4
Expand Up @@ -6,5 +6,6 @@ if test "$PHP_PROTOBUF" != "no"; then
protobuf,
arena.c array.c convert.c def.c map.c message.c names.c php-upb.c protobuf.c third_party/utf8_range/naive.c third_party/utf8_range/range2-neon.c third_party/utf8_range/range2-sse.c,
$ext_shared, , -std=gnu99)
PHP_ADD_BUILD_DIR($ext_builddir/third_party/utf8_range)

fi