Skip to content
Open
Show file tree
Hide file tree
Changes from 39 commits
Commits
Show all changes
52 commits
Select commit Hold shift + click to select a range
9f80d6b
Add dev:gen-ext-test-matrix command
crazywhalecc May 8, 2026
4507c8f
Fix zig check on fresh installed spc
crazywhalecc May 8, 2026
6b6025d
Add parallel download
crazywhalecc May 8, 2026
a8a8516
Fix memcache build on PHP 8.5
crazywhalecc May 8, 2026
a980b0a
Use -i instead of -I (-I used by hardcoded INI)
crazywhalecc May 8, 2026
143ae4b
Use -i instead of -I (-I used by hardcoded INI)
crazywhalecc May 8, 2026
a19c447
Fix frameworks in unix cmake executor wrongly used by linux
crazywhalecc May 8, 2026
641ad8b
Add patch for PHP 8.2 compatibility in imap extension
crazywhalecc May 8, 2026
5529e66
Add dom deps for xmlreader
crazywhalecc May 8, 2026
be03980
Add exclude for gen-ext-test-matrix
crazywhalecc May 8, 2026
1d1f58f
Disable parallel downloading
crazywhalecc May 8, 2026
5e40982
Use windows-latest
crazywhalecc May 8, 2026
37b5f89
Add extra build flags for specific extensions
crazywhalecc May 8, 2026
4695f84
Add macOS test
crazywhalecc May 8, 2026
dcf1c59
Add macOS test, conflicts
crazywhalecc May 8, 2026
73bf9ff
Add libzstd.lib for windows builds
crazywhalecc May 8, 2026
fd4bf90
Add standalone list
crazywhalecc May 8, 2026
01607a0
Add spx compatible command arg
crazywhalecc May 8, 2026
ee21199
Remove hosted binary temporarily
crazywhalecc May 8, 2026
c374163
Fix windows mpir build
crazywhalecc May 8, 2026
61747f6
Add frameworks for glfw
crazywhalecc May 8, 2026
1b30c98
Make glfw standalone though
crazywhalecc May 8, 2026
e4201a2
Add 'imagick' and 'intl' to standalone array
crazywhalecc May 8, 2026
04df87c
Make intl use c++17
crazywhalecc May 9, 2026
4f9a555
ds use git (pecl have buggy config.w32)
crazywhalecc May 9, 2026
bf326de
Fix extracting hosted type for zip archive caused overwriting
crazywhalecc May 9, 2026
bf308e8
Remove duplicate phar patch for micro
crazywhalecc May 9, 2026
b09cc96
Add curl execute output log
crazywhalecc May 9, 2026
ad74752
Merge remote-tracking branch 'origin/v3-docs/readme' into v3-docs/readme
crazywhalecc May 9, 2026
cd803c7
Add filtering options for extensions, libs, and OS in test matrix gen…
crazywhalecc May 9, 2026
e930873
Add tier 2 support for actions runner test
crazywhalecc May 9, 2026
af3c6a6
Move build command here
crazywhalecc May 9, 2026
e664245
Fix opentelemetry strict flag
crazywhalecc May 9, 2026
184a091
Implicitly define swow dependencies (due to extension generating and …
crazywhalecc May 9, 2026
2ed4b10
Make brotli and zstd as dep
crazywhalecc May 9, 2026
7b79767
Add retry mechanism to Git clone and GitHub release fetching methods
crazywhalecc May 9, 2026
629b5b6
Add test-bot
crazywhalecc May 9, 2026
ceade30
phpstan fix
crazywhalecc May 9, 2026
270f131
Add label event
crazywhalecc May 9, 2026
6ad4b6a
Add concurrency settings to GitHub Actions workflow
crazywhalecc May 9, 2026
9dbb178
Potential fix for pull request finding
crazywhalecc May 9, 2026
e63d49e
Disable pdo pgsql hook for swow temporarily
crazywhalecc May 9, 2026
64d9650
Fix compiler extra appending
crazywhalecc May 9, 2026
079a30c
Add tmate session setup for debugging on failure
crazywhalecc May 10, 2026
21c8684
Update tests.yml
crazywhalecc May 10, 2026
02d8f51
Enhance Unix Makefile patch to disable auto-vectorization for zig-cc …
crazywhalecc May 10, 2026
7107566
Fix wrongly constructed class
crazywhalecc May 10, 2026
0469b65
Revert
crazywhalecc May 10, 2026
2cc3c8c
Revert
crazywhalecc May 10, 2026
36e738f
strange there
crazywhalecc May 10, 2026
c186038
Use system cc instead
crazywhalecc May 10, 2026
b8ee484
Comment upterm session
crazywhalecc May 10, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
221 changes: 137 additions & 84 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
name: Tests
name: v3 Tests

on:
pull_request:
branches: [ "main", "v3" ]
types: [ opened, synchronize, reopened ]
branches: [ "v3" ]
types: [ opened, synchronize, reopened, labeled, unlabeled ]
paths:
- 'src/**'
- 'config/**'
Expand Down Expand Up @@ -103,114 +103,167 @@ jobs:
run: composer install -q --no-ansi --no-interaction --no-scripts --no-progress --prefer-dist

- name: "Run PHPUnit Tests"
run: SPC_LIBC=glibc vendor/bin/phpunit tests/ --no-coverage
run: vendor/bin/phpunit tests/ --no-coverage

define-matrix:
if: false # TODO: enable when refactoring workflows
name: "Define Matrix"
check-gate:
name: "Check: need-test label"
runs-on: ubuntu-latest
outputs:
php: ${{ steps.gendef.outputs.php }}
os: ${{ steps.gendef.outputs.os }}
enabled: ${{ steps.gate.outputs.enabled }}
steps:
- name: "Checkout"
uses: actions/checkout@v4
- name: Check label
id: gate
run: |
LABELS='${{ toJSON(github.event.pull_request.labels.*.name) }}'
if echo "$LABELS" | grep -q '"need-test"'; then
echo "enabled=true" >> "$GITHUB_OUTPUT"
else
echo "enabled=false" >> "$GITHUB_OUTPUT"
fi

test-bot:
name: "Test Bot: analyze PR"
needs: check-gate
if: needs.check-gate.outputs.enabled == 'true'
runs-on: ubuntu-latest
permissions:
pull-requests: write
contents: read
outputs:
need_test: ${{ steps.bot.outputs.need_test }}
gen_matrix_args: ${{ steps.bot.outputs.gen_matrix_args }}
gen_matrix_args_tier2: ${{ steps.bot.outputs.gen_matrix_args_tier2 }}
php_versions: ${{ steps.bot.outputs.php_versions }}
tier2: ${{ steps.bot.outputs.tier2 }}
steps:
- uses: actions/checkout@v4

- name: "Setup PHP"
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: 8.4
php-version: '8.4'
extensions: curl, openssl, mbstring
ini-values: memory_limit=-1
tools: composer

- name: Install dependencies
run: composer install -q --no-ansi --no-interaction --no-scripts --no-progress --prefer-dist --no-dev

- name: Define
id: gendef
- name: Run dev:test-bot
id: bot
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
PHP_VERSIONS=$(php src/globals/test-extensions.php php)
OS_VERSIONS=$(php src/globals/test-extensions.php os)
echo 'php='"$PHP_VERSIONS" >> "$GITHUB_OUTPUT"
echo 'os='"$OS_VERSIONS" >> "$GITHUB_OUTPUT"
BOT_JSON=$(php -d opcache.enable_cli=0 bin/spc dev:test-bot \
--pr=${{ github.event.pull_request.number }} \
--repo=${{ github.repository }} 2>/dev/null)

echo "need_test=$(echo "$BOT_JSON" | jq -r '.need_test')" >> "$GITHUB_OUTPUT"
echo "gen_matrix_args=$(echo "$BOT_JSON" | jq -r '.gen_matrix_args')" >> "$GITHUB_OUTPUT"
echo "gen_matrix_args_tier2=$(echo "$BOT_JSON" | jq -r '.gen_matrix_args_tier2')" >> "$GITHUB_OUTPUT"
echo "php_versions=$(echo "$BOT_JSON" | jq -c '.php_versions')" >> "$GITHUB_OUTPUT"
echo "tier2=$(echo "$BOT_JSON" | jq -r '.tier2')" >> "$GITHUB_OUTPUT"

COMMENT_BODY=$(echo "$BOT_JSON" | jq -r '.comment_body')
MARKER="<!-- spc-test-bot -->"

# Find existing bot comment id
EXISTING_ID=$(gh api \
repos/${{ github.repository }}/issues/${{ github.event.pull_request.number }}/comments \
--jq "[.[] | select(.body | startswith(\"$MARKER\")) | .id] | first // empty")

if [ -n "$EXISTING_ID" ]; then
gh api --method PATCH \
repos/${{ github.repository }}/issues/comments/"$EXISTING_ID" \
-f body="$COMMENT_BODY"
else
gh pr comment ${{ github.event.pull_request.number }} \
--repo ${{ github.repository }} \
--body "$COMMENT_BODY"
fi

gen-matrix:
name: "Generate test matrix"
needs: test-bot
if: needs.test-bot.outputs.need_test == 'true'
runs-on: ubuntu-latest
outputs:
matrix: ${{ steps.build.outputs.matrix }}
steps:
- uses: actions/checkout@v4

- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: '8.4'
extensions: curl, openssl, mbstring
ini-values: memory_limit=-1
tools: composer

- name: Install dependencies
run: composer install -q --no-ansi --no-interaction --no-scripts --no-progress --prefer-dist --no-dev

build:
if: false
name: "Build PHP Test (PHP ${{ matrix.php }} ${{ matrix.os }})"
runs-on: ${{ matrix.os }}
needs: [define-matrix, php-cs-fixer, phpstan, phpunit]
- name: Build matrix
id: build
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GEN_MATRIX_ARGS: ${{ needs.test-bot.outputs.gen_matrix_args }}
GEN_MATRIX_ARGS_TIER2: ${{ needs.test-bot.outputs.gen_matrix_args_tier2 }}
PHP_VERSIONS: ${{ needs.test-bot.outputs.php_versions }}
TIER2: ${{ needs.test-bot.outputs.tier2 }}
run: |
# Tier1 matrix
MATRIX1=$(bin/spc dev:gen-ext-test-matrix $GEN_MATRIX_ARGS 2>/dev/null)

# Merge Tier2 if requested
if [ "$TIER2" = "true" ] && [ -n "$GEN_MATRIX_ARGS_TIER2" ]; then
MATRIX2=$(bin/spc dev:gen-ext-test-matrix $GEN_MATRIX_ARGS_TIER2 2>/dev/null)
COMBINED=$(jq -n --argjson m1 "$MATRIX1" --argjson m2 "$MATRIX2" '$m1 + $m2')
else
COMBINED=$MATRIX1
fi

# Expand PHP versions: cartesian product of entries × php_versions
FINAL=$(echo "$COMBINED" | jq --argjson versions "$PHP_VERSIONS" \
'[.[] | . as $entry | $versions[] | $entry + {"php-version": .}]')

echo "matrix=$(echo "$FINAL" | jq -c '{"combo": .}')" >> "$GITHUB_OUTPUT"

ext-test:
name: "Ext test: ${{ matrix.combo.extension }} (PHP ${{ matrix.combo.php-version }} · ${{ matrix.combo.os }}-${{ matrix.combo.arch }})"
needs: gen-matrix
runs-on: ${{ matrix.combo.runner }}
timeout-minutes: 120
strategy:
matrix:
php: ${{ fromJSON(needs.define-matrix.outputs.php) }}
os: ${{ fromJSON(needs.define-matrix.outputs.os) }}
fail-fast: false
matrix: ${{ fromJSON(needs.gen-matrix.outputs.matrix) }}
steps:
- name: "Update runner packages"
if: ${{ startsWith(matrix.os, 'ubuntu-') }}
run: sudo apt-get update && sudo apt-get install -y ca-certificates
- uses: actions/checkout@v4

- name: "Checkout"
uses: actions/checkout@v4

- name: "Setup PHP"
- 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
tools: composer
env:
phpts: nts

- name: "Cache composer packages"
id: composer-cache
uses: actions/cache@v4
with:
path: vendor
key: ${{ runner.os }}-php-${{ hashFiles('**/composer.lock') }}
restore-keys: |
${{ runner.os }}-php-
- name: Install dependencies
run: composer install -q --no-ansi --no-interaction --no-scripts --no-progress --prefer-dist --no-dev

# Cache downloaded source
- id: cache-download
uses: actions/cache@v4
with:
path: downloads
key: php-dependencies-${{ matrix.os }}

- name: "Install Dependencies"
run: composer update -vvv --no-ansi --no-interaction --no-scripts --no-progress --prefer-dist --no-plugins

- name: "Run Build Tests (doctor)"
run: php src/globals/test-extensions.php doctor_cmd ${{ matrix.os }} ${{ matrix.php }}

- name: "Prepare UPX for Windows"
if: ${{ startsWith(matrix.os, 'windows-') }}
run: |
php src/globals/test-extensions.php install_upx_cmd ${{ matrix.os }} ${{ matrix.php }}
echo "UPX_CMD=$(php src/globals/test-extensions.php upx)" >> $env:GITHUB_ENV

- name: "Prepare UPX for Linux"
if: ${{ startsWith(matrix.os, 'ubuntu-') }}
- name: Build
env:
SPC_USE_SUDO: "yes"
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
php src/globals/test-extensions.php install_upx_cmd ${{ matrix.os }} ${{ matrix.php }}
echo "UPX_CMD=$(php src/globals/test-extensions.php upx)" >> $GITHUB_ENV

- name: "Run Build Tests (download)"
run: php src/globals/test-extensions.php download_cmd ${{ matrix.os }} ${{ matrix.php }}
./bin/spc doctor --auto-fix
${{ matrix.combo.build-args }}
Comment thread
crazywhalecc marked this conversation as resolved.
Outdated

- name: "Run Build Tests (build)"
run: php src/globals/test-extensions.php build_cmd ${{ matrix.os }} ${{ matrix.php }}

- name: "Run Build Tests (build - embed for non-windows)"
if: ${{ !startsWith(matrix.os, 'windows-') }}
run: php src/globals/test-extensions.php build_embed_cmd ${{ matrix.os }} ${{ matrix.php }}

- name: "Upload logs"
if: ${{ always() && hashFiles('log/**') != '' }}
uses: actions/upload-artifact@v7
- name: Upload logs
if: always() && hashFiles('log/**') != ''
uses: actions/upload-artifact@v4
with:
name: build-logs-${{ matrix.os }}-${{ matrix.php }}
name: logs-${{ matrix.combo.os }}-${{ matrix.combo.arch }}-${{ matrix.combo.extension }}-php${{ matrix.combo.php-version }}
path: log

# - name: Setup tmate session
# if: ${{ failure() }}
# uses: mxschmitt/action-tmate@v3
1 change: 0 additions & 1 deletion config/artifact/ncurses.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
ncurses:
binary: hosted
metadata:
license-files:
- COPYING
Expand Down
1 change: 1 addition & 0 deletions config/pkg/ext/builtin-extensions.yml
Original file line number Diff line number Diff line change
Expand Up @@ -348,6 +348,7 @@ ext-xmlreader:
type: php-extension
depends:
- ext-xml
- ext-dom
php-extension:
arg-type: enable
build-with-php: true
Expand Down
6 changes: 4 additions & 2 deletions config/pkg/ext/ext-ds.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,10 @@ ext-ds:
type: php-extension
artifact:
source:
type: pecl
name: ds
type: git
url: 'https://github.com/php-ds/ext-ds.git'
rev: master
extract: php-src/ext/ds
metadata:
license-files: [LICENSE]
license: MIT
5 changes: 0 additions & 5 deletions config/pkg/ext/ext-swow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,5 @@ ext-swow:
metadata:
license: Apache-2.0
license-files: [LICENSE]
suggests:
- openssl
- curl
- ext-openssl
- ext-curl
php-extension:
arg-type: custom
1 change: 0 additions & 1 deletion config/pkg/lib/brotli.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ brotli:
type: ghtagtar
repo: google/brotli
match: 'v1\.\d.*'
binary: hosted
metadata:
license-files: [LICENSE]
license: MIT
Expand Down
1 change: 0 additions & 1 deletion config/pkg/lib/bzip2.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ bzip2:
type: filelist
url: 'https://sourceware.org/pub/bzip2/'
regex: '/href="(?<file>bzip2-(?<version>[^"]+)\.tar\.gz)"/'
binary: hosted
metadata:
license-files: ['@/bzip2.txt']
license: bzip2-1.0.6
Expand Down
6 changes: 6 additions & 0 deletions config/pkg/lib/glfw.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,12 @@
glfw:
type: library
artifact: glfw
frameworks:
- Cocoa
- CoreFoundation
- CoreVideo
- IOKit
- QuartzCore
headers:
- GLFW/glfw3.h
- GLFW/glfw3native.h
Expand Down
1 change: 0 additions & 1 deletion config/pkg/lib/libcares.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ libcares:
type: filelist
url: 'https://c-ares.org/download/'
regex: '/href="\/download\/(?<file>c-ares-(?<version>[^"]+)\.tar\.gz)"/'
binary: hosted
metadata:
license-files: [LICENSE.md]
headers@unix:
Expand Down
1 change: 0 additions & 1 deletion config/pkg/lib/libedit.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ libedit:
type: filelist
url: 'https://thrysoee.dk/editline/'
regex: '/href="(?<file>libedit-(?<version>[^"]+)\.tar\.gz)"/'
binary: hosted
metadata:
license-files: [COPYING]
license: BSD-3-Clause
Expand Down
1 change: 0 additions & 1 deletion config/pkg/lib/libiconv.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ libiconv:
type: filelist
url: 'https://ftp.gnu.org/gnu/libiconv/'
regex: '/href="(?<file>libiconv-(?<version>[^"]+)\.tar\.gz)"/'
binary: hosted
metadata:
license-files: [COPYING.LIB]
license: LGPL-2.0-or-later
Expand Down
1 change: 0 additions & 1 deletion config/pkg/lib/libpng.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ libpng:
repo: pnggroup/libpng
match: v1\.6\.\d+
query: '?per_page=150'
binary: hosted
metadata:
license-files: [LICENSE]
license: PNG
Expand Down
1 change: 0 additions & 1 deletion config/pkg/lib/libsodium.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ libsodium:
repo: jedisct1/libsodium
match: 'libsodium-(?!1\.0\.21)\d+(\.\d+)*\.tar\.gz'
prefer-stable: true
binary: hosted
metadata:
license-files: [LICENSE]
pkg-configs:
Expand Down
1 change: 0 additions & 1 deletion config/pkg/lib/libssh2.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ libssh2:
repo: libssh2/libssh2
match: libssh2.+\.tar\.gz
prefer-stable: true
binary: hosted
metadata:
license-files: [COPYING]
license: BSD-3-Clause
Expand Down
1 change: 0 additions & 1 deletion config/pkg/lib/libunistring.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ libunistring:
type: filelist
url: 'https://ftp.gnu.org/gnu/libunistring/'
regex: '/href="(?<file>libunistring-(?<version>[^"]+)\.tar\.gz)"/'
binary: hosted
metadata:
license-files: [COPYING.LIB]
license: LGPL-3.0-or-later
Expand Down
1 change: 0 additions & 1 deletion config/pkg/lib/openssl.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ openssl:
type: filelist
url: 'https://www.openssl.org/source/'
regex: '/href="(?<file>openssl-(?<version>3\.[^"]+)\.tar\.gz)"/'
binary: hosted
metadata:
license-files: [LICENSE.txt]
license: OpenSSL
Expand Down
Loading
Loading