Skip to content

Commit 3c1abed

Browse files
authored
Test compiling extension with PECL (#8)
1 parent d91af03 commit 3c1abed

File tree

1 file changed

+43
-0
lines changed

1 file changed

+43
-0
lines changed

Diff for: .github/workflows/continuous-integration.yml

+43
Original file line numberDiff line numberDiff line change
@@ -181,3 +181,46 @@ jobs:
181181

182182
- name: "Run tests (Pest)"
183183
run: "composer dev:test:pest -- --colors=always"
184+
185+
pecl:
186+
strategy:
187+
matrix:
188+
include:
189+
- php-image: "php:8.2-cli-alpine3.18"
190+
deps-command: "apk add $PHPIZE_DEPS git icu-dev"
191+
- php-image: "php:8.2-cli-bookworm"
192+
deps-command: "apt update && apt install -qy git libicu-dev"
193+
name: "Install with pecl on ${{ matrix.php-image }}"
194+
runs-on: "ubuntu-latest"
195+
container: ${{ matrix.php-image }}
196+
steps:
197+
- name: "Install system dependencies"
198+
run: ${{ matrix.deps-command }}
199+
200+
- name: "Checkout repository"
201+
uses: "actions/checkout@v3"
202+
203+
- name: "Create temporary directory"
204+
run: cd "$(mktemp -d)"
205+
206+
- name: "Create package"
207+
run: pecl package "$GITHUB_WORKSPACE/package.xml"
208+
209+
- name: "Compile package"
210+
run: printf '' | MAKE="make -j$(nproc)" pecl install ecma_intl-*.tgz
211+
212+
- name: "Enable extension"
213+
run: docker-php-ext-enable ecma_intl
214+
215+
- name: "Check for PHP startup warnings"
216+
run: |
217+
php -d display_errors=stderr -d display_startup_errors=1 -d error_reporting=-1 -r ';' 2>./php-startup-warnings
218+
if [ -s ./php-startup-warnings ]; then
219+
echo 'The PHP extension was successfully installed, but PHP raised these warnings:' >&2
220+
cat ./php-startup-warnings >&2
221+
exit 1
222+
fi
223+
echo "PHP didn't raise any warnings at startup."
224+
225+
- name: Inspect extension
226+
run: php --ri ecma_intl

0 commit comments

Comments
 (0)