static-php-cli/.github/workflows/ext-matrix-tests.yml
2025-06-11 21:37:00 +08:00

116 lines
3.3 KiB
YAML

name: "Extension matrix tests"
on:
workflow_dispatch:
pull_request:
branches: [ "main" ]
paths:
- '.github/workflows/ext-matrix-tests.yml'
jobs:
test:
name: "${{ matrix.extension }} (PHP ${{ matrix.php-version }} on ${{ matrix.operating-system }})"
runs-on: ${{ matrix.operating-system }}
strategy:
fail-fast: false
matrix:
extension:
- dom,amqp
- dom,ast
- dom,brotli
- dom,dio
- dom,ds
- dom,ev
- dom,ffi
- dom,gettext
- dom,gmssl
- dom,igbinary
- dom,ldap
- dom,libxml
- dom,lz4
- dom,memcache
- dom,mongodb
- dom,msgpack
- dom,odbc
- dom,opentelemetry
- dom,parallel
- dom,pdo_odbc
- dom,pdo_sqlsrv
- dom,rar
- dom,rdkafka
- dom,spx
- dom,sqlsrv
- dom,ssh2
- dom,tidy
- dom,uuid
- dom,uv
- dom,xhprof
- dom,xlswriter
- dom,xz
- dom,yac
- dom,yaml
- dom,zstd
php-version:
- "8.4"
operating-system:
#- "ubuntu-latest"
#- "macos-13"
#- "debian-arm64-self-hosted"
- "macos-15"
steps:
- name: "Checkout"
uses: "actions/checkout@v4"
- name: OS type
id: os-type
run: |
OS=""
if [ "${{ matrix.operating-system }}" = "ubuntu-latest" ]; then
OS="linux-x86_64"
elif [ "${{ matrix.operating-system }}" = "macos-13" ]; then
OS="macos-x86_64"
elif [ "${{ matrix.operating-system }}" = "debian-arm64-self-hosted" ]; then
OS="linux-aarch64"
elif [ "${{ matrix.operating-system }}" = "macos-14" ]; then
OS="macos-aarch64"
fi
echo "OS=$OS" >> $GITHUB_ENV
- name: "Setup PHP"
uses: shivammathur/setup-php@v2
with:
php-version: 8.4
tools: pecl, composer
extensions: curl, openssl, mbstring
ini-values: memory_limit=-1
env:
phpts: nts
- name: "Install Dependencies"
run: composer update -q --no-ansi --no-interaction --no-scripts --no-progress --prefer-dist
- id: cache-download
uses: actions/cache@v4
with:
path: downloads
key: php-${{ matrix.php-version }}-dependencies-for-tests
# If there's no dependencies cache, fetch sources
- name: "Download sources"
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: ./bin/spc download --with-php=${{ matrix.php-version }} --for-extensions=${{ matrix.extension }} --debug --ignore-cache-sources=php-src
- name: "Build library: ${{ matrix.library }}"
run: |
SPC_USE_SUDO=yes ./bin/spc doctor --auto-fix
if [ "${{ env.OS }}" = "linux-x86_64" ]; then
./bin/spc install-pkg upx
UPX=--with-upx-pack
elif [ "${{ env.OS }}" = "linux-aarch64" ]; then
./bin/spc install-pkg upx
UPX=--with-upx-pack
fi
./bin/spc build --build-embed ${{ matrix.extension }} --debug $UPX --with-suggested-libs --with-suggested-exts --enable-zts