Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
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
23 changes: 20 additions & 3 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,10 @@ jobs:
PDO_MYSQL_TEST_PASS: ''
PDO_MYSQL_TEST_USER: root
PDO_PGSQL_TEST_DSN: 'pgsql:host=127.0.0.1 port=5432 dbname=test user=postgres password=postgres'
CCACHE_BASEDIR: /home/circleci/project
CCACHE_COMPILERCHECK: content
CCACHE_DIR: /home/circleci/.cache/ccache
CCACHE_MAXSIZE: 500M
steps:
- checkout
- run:
Expand Down Expand Up @@ -78,12 +82,18 @@ jobs:
libqdbm-dev \
libjpeg-dev \
libpng-dev \
libfreetype-dev
libfreetype-dev \
ccache
- restore_cache:
keys:
- ccache-v1-arm-gcc-{{ checksum "main/php_version.h" }}-{{ .Branch }}-{{ .Revision }}
- ccache-v1-arm-gcc-{{ checksum "main/php_version.h" }}-{{ .Branch }}-
- ccache-v1-arm-gcc-{{ checksum "main/php_version.h" }}-master-
- run:
name: ./configure
command: |
./buildconf -f
./configure \
CC="ccache gcc" CXX="ccache g++" ./configure \
--enable-debug \
--enable-zts \
--enable-option-checking=fatal \
Expand Down Expand Up @@ -153,7 +163,14 @@ jobs:
- run:
name: make
no_output_timeout: 30m
command: make -j2 > /dev/null
command: |
ccache --zero-stats
make -j2 > /dev/null
ccache --show-stats
- save_cache:
key: ccache-v1-arm-gcc-{{ checksum "main/php_version.h" }}-{{ .Branch }}-{{ .Revision }}
paths:
- /home/circleci/.cache/ccache
- run:
name: make install
command: |
Expand Down
30 changes: 12 additions & 18 deletions .github/actions/apt-x64/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@ inputs:
asan:
default: false
required: false
skipSlow:
default: false
required: false
runs:
using: composite
steps:
Expand All @@ -11,6 +14,13 @@ runs:
set -x

OPCACHE_TLS_TESTS_DEPS="gcc clang lld"
SLOW_EXTENSION_DEPS=""
if [[ "${{ inputs.skipSlow }}" == "false" ]]; then
SLOW_EXTENSION_DEPS="ldap-utils slapd libtidy-dev libenchant-2-dev libsasl2-dev"
SLOW_EXTENSION_DEPS+=" libsqlite3-mod-spatialite libpq-dev libldap2-dev libsnmp-dev"
SLOW_EXTENSION_DEPS+=" postgresql postgresql-contrib snmpd snmp-mibs-downloader"
SLOW_EXTENSION_DEPS+=" freetds-dev unixodbc-dev libsqliteodbc firebird-dev"
fi

export DEBIAN_FRONTEND=noninteractive

Expand All @@ -30,52 +40,36 @@ runs:
bison \
re2c \
locales \
ldap-utils \
openssl \
slapd \
language-pack-de \
libgmp-dev \
libicu-dev \
libtidy-dev \
libenchant-2-dev \
libbz2-dev \
libsasl2-dev \
libxpm-dev \
libzip-dev \
libsqlite3-dev \
libsqlite3-mod-spatialite \
libwebp-dev \
${{ inputs.asan == 'false' && 'libavif-dev' || '' }} \
libonig-dev \
libcurl4-openssl-dev \
libxml2-dev \
libxslt1-dev \
libpq-dev \
libedit-dev \
libldap2-dev \
libsodium-dev \
libargon2-dev \
libmm-dev \
libsnmp-dev \
postgresql \
postgresql-contrib \
snmpd \
snmp-mibs-downloader \
freetds-dev \
unixodbc-dev \
libsqliteodbc \
llvm \
clang \
dovecot-core \
dovecot-pop3d \
dovecot-imapd \
sendmail \
firebird-dev \
liblmdb-dev \
libtokyocabinet-dev \
libdb-dev \
libqdbm-dev \
libjpeg-dev \
libpng-dev \
libfreetype6-dev \
$OPCACHE_TLS_TESTS_DEPS
$OPCACHE_TLS_TESTS_DEPS \
$SLOW_EXTENSION_DEPS
14 changes: 9 additions & 5 deletions .github/actions/ccache/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,9 @@ inputs:
cxx:
required: false
default: 'g++'
save:
required: false
default: true
runs:
using: composite
steps:
Expand All @@ -21,17 +24,18 @@ runs:
major=$(cat ${{ inputs.php_directory }}/main/php_version.h | sed -En 's/^#define PHP_MAJOR_VERSION ([0-9]+)/\1/p')
minor=$(cat ${{ inputs.php_directory }}/main/php_version.h | sed -En 's/^#define PHP_MINOR_VERSION ([0-9]+)/\1/p')
release=$(cat ${{ inputs.php_directory }}/main/php_version.h | sed -En 's/^#define PHP_RELEASE_VERSION ([0-9]+)/\1/p')
week=$(date +"%Y-%W")
prefix="${{ inputs.name }}-$major.$minor.$release"
echo "key=$prefix-$week" >> $GITHUB_OUTPUT
echo "prefix=$prefix-" >> $GITHUB_OUTPUT
# GitHub cache entries are immutable, so each commit needs a new key.
echo "key=$prefix-$GITHUB_SHA" >> $GITHUB_OUTPUT
echo "prefix=$prefix" >> $GITHUB_OUTPUT
- name: ccache
uses: hendrikmuhs/ccache-action@v1.2
uses: hendrikmuhs/ccache-action@d62db5f07c26379fc4b4e0916f098a92573c3b03 # v1.2.23
with:
key: "${{ steps.cache_key.outputs.key }}"
append-timestamp: false
restore-keys: "${{ steps.cache_key.outputs.prefix }}"
save: ${{ github.event_name != 'pull_request' }}
# GitHub isolates caches saved by PR merge refs from base branches and other PRs.
save: ${{ inputs.save == 'true' }}
- name: Export CC/CXX
shell: bash
run: |
Expand Down
38 changes: 24 additions & 14 deletions .github/actions/setup-windows/action.yml
Original file line number Diff line number Diff line change
@@ -1,21 +1,31 @@
name: Setup
name: Setup Windows build tools
runs:
using: composite
steps:
- name: Setup MySQL
shell: cmd
run: |
mysqld --initialize-insecure
mysqld --install
net start MySQL
mysql --port=3306 --user=root --password="" -e "ALTER USER 'root'@'localhost' IDENTIFIED BY 'Password12!'; FLUSH PRIVILEGES;"
- name: Setup MSSQL
- name: Install jom
shell: pwsh
run: |
choco install sql-server-express -y --no-progress --install-arguments="/SECURITYMODE=SQL /SAPWD=Password12!"
- name: Setup PostgreSQL
$jomDirectory = Join-Path $env:RUNNER_TEMP "jom"
$jomArchive = Join-Path $env:RUNNER_TEMP "jom.zip"
Invoke-WebRequest https://download.qt.io/official_releases/jom/jom_1_1_7.zip -OutFile $jomArchive
if ((Get-FileHash $jomArchive -Algorithm SHA256).Hash -ne "4C8AF345586A9A08FBFD2F613FCAC748226D91A75627AA3581B297DD513046FE") {
throw "Unexpected jom archive checksum"
}
Expand-Archive $jomArchive -DestinationPath $jomDirectory
$jomDirectory | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append
- name: Install sccache
if: ${{ env.CLANG_TOOLSET != '1' }}
shell: pwsh
run: |
$postgresService = if ($env:PHP_BUILD_CRT -eq "vs18") { "postgresql-x64-17" } else { "postgresql-x64-14" }
Set-Service -Name $postgresService -StartupType manual -Status Running
pwsh -Command { $env:PGPASSWORD="root"; & "$env:PGBIN\psql" -U postgres -c "ALTER USER postgres WITH PASSWORD 'Password12!';" }
$sccacheDirectory = Join-Path $env:RUNNER_TEMP "sccache-bin"
$sccacheCacheDirectory = Join-Path $env:RUNNER_TEMP "sccache"
$sccacheArchive = Join-Path $env:RUNNER_TEMP "sccache.zip"
Invoke-WebRequest https://github.com/mozilla/sccache/releases/download/v0.15.0/sccache-v0.15.0-x86_64-pc-windows-msvc.zip -OutFile $sccacheArchive
if ((Get-FileHash $sccacheArchive -Algorithm SHA256).Hash -ne "DCF489090AA5EF4C7D145E8B29F759124C803D636C3107F397BD50D425B5F341") {
throw "Unexpected sccache archive checksum"
}
Expand-Archive $sccacheArchive -DestinationPath $sccacheDirectory
(Join-Path $sccacheDirectory "sccache-v0.15.0-x86_64-pc-windows-msvc") |
Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append
"SCCACHE_DIR=$sccacheCacheDirectory" |
Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
15 changes: 14 additions & 1 deletion .github/actions/test-alpine/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,12 @@ inputs:
jitType:
default: 'disable'
required: false
testShard:
default: 1
required: false
testShards:
default: 1
required: false
runs:
using: composite
steps:
Expand All @@ -17,6 +23,12 @@ runs:
set -x
export SKIP_IO_CAPTURE_TESTS=1
export STACK_LIMIT_DEFAULTS_CHECK=1
test_shard_options=()
if [[ "${{ inputs.testShards }}" -gt 1 ]]; then
sapi/cli/php .github/scripts/generate_test_shard.php \
"${{ inputs.testShard }}" "${{ inputs.testShards }}" "$RUNNER_TEMP/php-test-shard.txt"
test_shard_options=(-r "$RUNNER_TEMP/php-test-shard.txt")
fi
sapi/cli/php run-tests.php -P -q ${{ inputs.runTestsParameters }} \
${{ inputs.enableOpcache == 'true' && '-d opcache.enable_cli=1' || '' }} \
-d opcache.jit=${{ inputs.jitType }} \
Expand All @@ -26,4 +38,5 @@ runs:
--no-progress \
--show-diff \
--show-slow 1000 \
--set-timeout 120
--set-timeout 120 \
"${test_shard_options[@]}"
15 changes: 14 additions & 1 deletion .github/actions/test-linux/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,12 @@ inputs:
idleCpu:
default: 'false'
required: false
testShard:
default: 1
required: false
testShards:
default: 1
required: false
runs:
using: composite
steps:
Expand Down Expand Up @@ -45,6 +51,12 @@ runs:
export SKIP_IO_CAPTURE_TESTS=1
export STACK_LIMIT_DEFAULTS_CHECK=1
export RUN_RESOURCE_HEAVY_TESTS=1
test_shard_options=()
if [[ "${{ inputs.testShards }}" -gt 1 ]]; then
sapi/cli/php .github/scripts/generate_test_shard.php \
"${{ inputs.testShard }}" "${{ inputs.testShards }}" "$RUNNER_TEMP/php-test-shard.txt"
test_shard_options=(-r "$RUNNER_TEMP/php-test-shard.txt")
fi
sapi/cli/php run-tests.php -P -q ${{ inputs.runTestsParameters }} \
${{ inputs.enableOpcache == 'true' && '-d opcache.enable_cli=1' || '' }} \
-d opcache.jit=${{ inputs.jitType }} \
Expand All @@ -56,4 +68,5 @@ runs:
--offline \
--show-diff \
--show-slow 1000 \
--set-timeout 120
--set-timeout 120 \
"${test_shard_options[@]}"
24 changes: 21 additions & 3 deletions .github/matrix.php
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,17 @@ function get_current_version(): array {
return [$major, $minor];
}

function with_test_shards(array $configuration, int $shards): array {
$configurations = [];
for ($shard = 1; $shard <= $shards; $shard++) {
$configurations[] = $configuration + [
'test_shard' => $shard,
'test_shards' => $shards,
];
}
return $configurations;
}

function select_jobs($repository, $trigger, $nightly, $labels, $php_version, $ref, $all_variations) {
$no_jobs = in_array('CI: No jobs', $labels, true);
$all_jobs = in_array('CI: All jobs', $labels, true) || $nightly;
Expand All @@ -66,7 +77,7 @@ function select_jobs($repository, $trigger, $nightly, $labels, $php_version, $re

$jobs = [];
if (version_compare($php_version, '8.4', '>=') && ($all_jobs || !$no_jobs || $test_alpine)) {
$jobs['ALPINE'] = true;
$jobs['ALPINE']['matrix']['include'] = with_test_shards([], $all_variations ? 1 : 3);
}
if (version_compare($php_version, '8.4', '>=')
&& !$nightly
Expand Down Expand Up @@ -113,8 +124,9 @@ function select_jobs($repository, $trigger, $nightly, $labels, $php_version, $re
],
]
: ['include' => [
['name' => '', 'asan' => false, 'debug' => false, 'repeat' => false, 'variation' => false, 'zts' => false],
['name' => '_ASAN', 'asan' => true, 'debug' => true, 'repeat' => false, 'variation' => false, 'zts' => true],
...with_test_shards(['name' => '', 'asan' => false, 'debug' => false, 'repeat' => false, 'test_mode' => 'normal', 'variation' => false, 'zts' => false], 1),
...with_test_shards(['name' => '', 'asan' => false, 'debug' => false, 'repeat' => false, 'test_mode' => 'function-jit', 'variation' => false, 'zts' => false], 1),
...with_test_shards(['name' => '_ASAN', 'asan' => true, 'debug' => true, 'repeat' => false, 'test_mode' => 'normal', 'variation' => false, 'zts' => true], 3),
]];
$jobs['LINUX_X64']['config']['variation_enable_zend_max_execution_timers'] = version_compare($php_version, '8.3', '>=');
}
Expand Down Expand Up @@ -147,7 +159,13 @@ function select_jobs($repository, $trigger, $nightly, $labels, $php_version, $re
if (version_compare($php_version, '8.6', '>=')) {
$matrix[] = ['asan' => false, 'opcache' => true, 'x64' => true, 'zts' => true, 'clang' => true];
}
} else {
$matrix = with_test_shards($matrix[0], 2);
}
foreach ($matrix as &$configuration) {
$configuration += ['test_shard' => 1, 'test_shards' => 1];
}
unset($configuration);
$jobs['WINDOWS']['matrix'] = ['include' => $matrix];
$jobs['WINDOWS']['config'] = match (true) {
version_compare($php_version, '8.6', '>=') => ['vs_crt_version' => 'vs18', 'runs_on' => 'windows-2025-vs2026'],
Expand Down
Loading
Loading