From be039802c027ce8c7d3a1ef042b1672fd02a0dbe Mon Sep 17 00:00:00 2001 From: crazywhalecc Date: Fri, 8 May 2026 20:54:41 +0800 Subject: [PATCH] Add exclude for gen-ext-test-matrix --- .../Command/Dev/GenExtTestMatrixCommand.php | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/src/StaticPHP/Command/Dev/GenExtTestMatrixCommand.php b/src/StaticPHP/Command/Dev/GenExtTestMatrixCommand.php index ffc94b52..0f938ef7 100644 --- a/src/StaticPHP/Command/Dev/GenExtTestMatrixCommand.php +++ b/src/StaticPHP/Command/Dev/GenExtTestMatrixCommand.php @@ -11,13 +11,20 @@ use Symfony\Component\Console\Attribute\AsCommand; #[AsCommand('dev:gen-ext-test-matrix', 'Generate GitHub Actions extension test matrix JSON', [], true)] class GenExtTestMatrixCommand extends BaseCommand { - private const BUILD_TARGETS = '--build-cli --build-cgi --build-micro --dl-parallel=10'; + private const string BUILD_TARGETS = '--build-cli --build-cgi --build-micro --dl-parallel=10'; - private const OS_RUNNERS = [ + private const array OS_RUNNERS = [ 'linux' => ['arch' => 'x86_64', 'runner' => 'ubuntu-latest', 'os_key' => 'Linux'], 'windows' => ['arch' => 'x86_64', 'runner' => 'windows-2025', 'os_key' => 'Windows'], ]; + /** + * Extensions excluded from specific OS matrix entries. + */ + private const array OS_EXCLUDE = [ + 'linux' => ['ext-glfw'], + ]; + protected bool $no_motd = true; public function handle(): int @@ -52,8 +59,9 @@ class GenExtTestMatrixCommand extends BaseCommand $os_key = $os_info['os_key']; // Filter by OS support - $os_regular = array_filter($all_regular, fn ($c) => $this->supportsOS($c, $os_key)); - $os_virtual = array_filter($all_virtual, fn ($c) => $this->supportsOS($c, $os_key)); + $os_exclude = array_fill_keys(self::OS_EXCLUDE[$os] ?? [], true); + $os_regular = array_filter($all_regular, fn ($c, $k) => $this->supportsOS($c, $os_key) && !isset($os_exclude[$k]), ARRAY_FILTER_USE_BOTH); + $os_virtual = array_filter($all_virtual, fn ($c, $k) => $this->supportsOS($c, $os_key) && !isset($os_exclude[$k]), ARRAY_FILTER_USE_BOTH); // Pool: all ext-* names available on this OS (regular + virtual) $pool_set = array_fill_keys(