mirror of
https://github.com/php/php-src.git
synced 2026-03-24 00:02:20 +01:00
Merge branch 'PHP-8.2' into PHP-8.3
* PHP-8.2: Backport nightly.yml and nightly_matrix.php to PHP-8.1
This commit is contained in:
143
.github/nightly_matrix.php
vendored
143
.github/nightly_matrix.php
vendored
@@ -1,23 +1,17 @@
|
||||
<?php
|
||||
|
||||
const BRANCHES = ['master', 'PHP-8.3', 'PHP-8.2', 'PHP-8.1', 'PHP-8.0'];
|
||||
const BRANCHES = [
|
||||
['name' => 'master', 'ref' => 'master', 'version' => ['major' => 8, 'minor' => 5]],
|
||||
['name' => 'PHP-8.4', 'ref' => 'PHP-8.4', 'version' => ['major' => 8, 'minor' => 4]],
|
||||
['name' => 'PHP-8.3', 'ref' => 'PHP-8.3', 'version' => ['major' => 8, 'minor' => 3]],
|
||||
['name' => 'PHP-8.2', 'ref' => 'PHP-8.2', 'version' => ['major' => 8, 'minor' => 2]],
|
||||
['name' => 'PHP-8.1', 'ref' => 'PHP-8.1', 'version' => ['major' => 8, 'minor' => 1]],
|
||||
];
|
||||
|
||||
function get_branch_commit_cache_file_path(): string {
|
||||
return dirname(__DIR__) . '/branch-commit-cache.json';
|
||||
}
|
||||
|
||||
function get_branch_matrix(array $branches) {
|
||||
$result = array_map(function ($branch) {
|
||||
$branch_key = strtoupper(str_replace('.', '', $branch));
|
||||
return [
|
||||
'name' => $branch_key,
|
||||
'ref' => $branch,
|
||||
];
|
||||
}, $branches);
|
||||
|
||||
return $result;
|
||||
}
|
||||
|
||||
function get_branches() {
|
||||
$branch_commit_cache_file = get_branch_commit_cache_file_path();
|
||||
$branch_commit_map = [];
|
||||
@@ -27,19 +21,19 @@ function get_branches() {
|
||||
|
||||
$changed_branches = [];
|
||||
foreach (BRANCHES as $branch) {
|
||||
$previous_commit_hash = $branch_commit_map[$branch] ?? null;
|
||||
$current_commit_hash = trim(shell_exec('git rev-parse origin/' . $branch));
|
||||
$previous_commit_hash = $branch_commit_map[$branch['ref']] ?? null;
|
||||
$current_commit_hash = trim(shell_exec('git rev-parse origin/' . $branch['ref']));
|
||||
|
||||
if ($previous_commit_hash !== $current_commit_hash) {
|
||||
$changed_branches[] = $branch;
|
||||
}
|
||||
|
||||
$branch_commit_map[$branch] = $current_commit_hash;
|
||||
$branch_commit_map[$branch['ref']] = $current_commit_hash;
|
||||
}
|
||||
|
||||
file_put_contents($branch_commit_cache_file, json_encode($branch_commit_map));
|
||||
|
||||
return get_branch_matrix($changed_branches);
|
||||
return $changed_branches;
|
||||
}
|
||||
|
||||
function get_matrix_include(array $branches) {
|
||||
@@ -55,29 +49,27 @@ function get_matrix_include(array $branches) {
|
||||
'test_function_jit' => false,
|
||||
'asan' => true,
|
||||
];
|
||||
if ($branch['ref'] !== 'PHP-8.0') {
|
||||
$jobs[] = [
|
||||
'name' => '_REPEAT',
|
||||
'branch' => $branch,
|
||||
'debug' => true,
|
||||
'zts' => false,
|
||||
'run_tests_parameters' => '--repeat 2',
|
||||
'timeout_minutes' => 360,
|
||||
'test_function_jit' => true,
|
||||
'asan' => false,
|
||||
];
|
||||
$jobs[] = [
|
||||
'name' => '_VARIATION',
|
||||
'branch' => $branch,
|
||||
'debug' => true,
|
||||
'zts' => true,
|
||||
'configuration_parameters' => "CFLAGS='-DZEND_RC_DEBUG=1 -DPROFITABILITY_CHECKS=0 -DZEND_VERIFY_FUNC_INFO=1'",
|
||||
$jobs[] = [
|
||||
'name' => '_REPEAT',
|
||||
'branch' => $branch,
|
||||
'debug' => true,
|
||||
'zts' => false,
|
||||
'run_tests_parameters' => '--repeat 2',
|
||||
'timeout_minutes' => 360,
|
||||
'test_function_jit' => true,
|
||||
'asan' => false,
|
||||
];
|
||||
$jobs[] = [
|
||||
'name' => '_VARIATION',
|
||||
'branch' => $branch,
|
||||
'debug' => true,
|
||||
'zts' => true,
|
||||
'configuration_parameters' => "CFLAGS='-DZEND_RC_DEBUG=1 -DPROFITABILITY_CHECKS=0 -DZEND_VERIFY_FUNC_INFO=1 -DZEND_VERIFY_TYPE_INFERENCE'",
|
||||
'run_tests_parameters' => '-d zend_test.observer.enabled=1 -d zend_test.observer.show_output=0',
|
||||
'timeout_minutes' => 360,
|
||||
'test_function_jit' => true,
|
||||
'asan' => false,
|
||||
];
|
||||
}
|
||||
'timeout_minutes' => 360,
|
||||
'test_function_jit' => true,
|
||||
'asan' => false,
|
||||
];
|
||||
}
|
||||
return $jobs;
|
||||
}
|
||||
@@ -101,19 +93,88 @@ function get_windows_matrix_include(array $branches) {
|
||||
return $jobs;
|
||||
}
|
||||
|
||||
function get_macos_matrix_include(array $branches) {
|
||||
$jobs = [];
|
||||
foreach ($branches as $branch) {
|
||||
foreach([true, false] as $debug) {
|
||||
foreach([true, false] as $zts) {
|
||||
$jobs[] = [
|
||||
'branch' => $branch,
|
||||
'debug' => $debug,
|
||||
'zts' => $zts,
|
||||
'os' => '13',
|
||||
'arch' => 'X64',
|
||||
'test_jit' => true,
|
||||
];
|
||||
if ($branch['version']['minor'] >= 4 || $branch['version']['major'] >= 9) {
|
||||
$jobs[] = [
|
||||
'branch' => $branch,
|
||||
'debug' => $debug,
|
||||
'zts' => $zts,
|
||||
'os' => '14',
|
||||
'arch' => 'ARM64',
|
||||
'test_jit' => !$zts,
|
||||
];
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return $jobs;
|
||||
}
|
||||
|
||||
function get_alpine_matrix_include(array $branches) {
|
||||
$jobs = [];
|
||||
foreach ($branches as $branch) {
|
||||
if ([$branch['version']['major'], $branch['version']['minor']] < [8, 4]) {
|
||||
continue;
|
||||
}
|
||||
$jobs[] = [
|
||||
'name' => '_ASAN_UBSAN',
|
||||
'branch' => $branch,
|
||||
'debug' => true,
|
||||
'zts' => true,
|
||||
'asan' => true,
|
||||
'test_jit' => true,
|
||||
'configuration_parameters' => "CFLAGS='-fsanitize=undefined,address -fno-sanitize=function -DZEND_TRACK_ARENA_ALLOC' LDFLAGS='-fsanitize=undefined,address -fno-sanitize=function' CC=clang-17 CXX=clang++-17",
|
||||
'run_tests_parameters' => '--asan -x',
|
||||
];
|
||||
}
|
||||
return $jobs;
|
||||
}
|
||||
|
||||
function get_current_version(): array {
|
||||
$file = dirname(__DIR__) . '/main/php_version.h';
|
||||
$content = file_get_contents($file);
|
||||
preg_match('(^#define PHP_MAJOR_VERSION (?<num>\d+)$)m', $content, $matches);
|
||||
$major = $matches['num'];
|
||||
preg_match('(^#define PHP_MINOR_VERSION (?<num>\d+)$)m', $content, $matches);
|
||||
$minor = $matches['num'];
|
||||
return ['major' => $major, 'minor' => $minor];
|
||||
}
|
||||
|
||||
$trigger = $argv[1] ?? 'schedule';
|
||||
$attempt = (int) ($argv[2] ?? 1);
|
||||
$discard_cache = ($trigger === 'schedule' && $attempt !== 1) || $trigger === 'workflow_dispatch';
|
||||
$monday = date('w', time()) === '1';
|
||||
$discard_cache = $monday
|
||||
|| ($trigger === 'schedule' && $attempt !== 1)
|
||||
|| $trigger === 'workflow_dispatch';
|
||||
if ($discard_cache) {
|
||||
@unlink(get_branch_commit_cache_file_path());
|
||||
}
|
||||
$branch = $argv[3] ?? 'master';
|
||||
|
||||
$branches = get_branches();
|
||||
$branches = $branch === 'master'
|
||||
? get_branches()
|
||||
: [['name' => strtoupper($branch), 'ref' => $branch, 'version' => get_current_version()]];
|
||||
$matrix_include = get_matrix_include($branches);
|
||||
$windows_matrix_include = get_windows_matrix_include($branches);
|
||||
$macos_matrix_include = get_macos_matrix_include($branches);
|
||||
$alpine_matrix_include = get_alpine_matrix_include($branches);
|
||||
|
||||
$f = fopen(getenv('GITHUB_OUTPUT'), 'a');
|
||||
fwrite($f, 'branches=' . json_encode($branches, JSON_UNESCAPED_SLASHES) . "\n");
|
||||
fwrite($f, 'matrix-include=' . json_encode($matrix_include, JSON_UNESCAPED_SLASHES) . "\n");
|
||||
fwrite($f, 'windows-matrix-include=' . json_encode($windows_matrix_include, JSON_UNESCAPED_SLASHES) . "\n");
|
||||
fwrite($f, 'macos-matrix-include=' . json_encode($macos_matrix_include, JSON_UNESCAPED_SLASHES) . "\n");
|
||||
fwrite($f, 'alpine-matrix-include=' . json_encode($alpine_matrix_include, JSON_UNESCAPED_SLASHES) . "\n");
|
||||
fclose($f);
|
||||
|
||||
245
.github/workflows/nightly.yml
vendored
245
.github/workflows/nightly.yml
vendored
@@ -8,12 +8,14 @@ permissions:
|
||||
jobs:
|
||||
GENERATE_MATRIX:
|
||||
name: Generate Matrix
|
||||
if: github.repository_owner == 'php' || github.event_name == 'workflow_dispatch'
|
||||
if: github.repository == 'php/php-src' || github.event_name == 'workflow_dispatch'
|
||||
runs-on: ubuntu-latest
|
||||
outputs:
|
||||
branches: ${{ steps.set-matrix.outputs.branches }}
|
||||
matrix-include: ${{ steps.set-matrix.outputs.matrix-include }}
|
||||
windows-matrix-include: ${{ steps.set-matrix.outputs.windows-matrix-include }}
|
||||
macos-matrix-include: ${{ steps.set-matrix.outputs.macos-matrix-include }}
|
||||
alpine-matrix-include: ${{ steps.set-matrix.outputs.alpine-matrix-include }}
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
with:
|
||||
@@ -22,7 +24,7 @@ jobs:
|
||||
# the correct commit hashes.
|
||||
fetch-depth: 0
|
||||
- name: Grab the commit mapping
|
||||
uses: actions/cache@v3
|
||||
uses: actions/cache@v4
|
||||
with:
|
||||
path: branch-commit-cache.json
|
||||
# The cache key needs to change every time for the
|
||||
@@ -32,12 +34,71 @@ jobs:
|
||||
nightly-
|
||||
- name: Generate Matrix
|
||||
id: set-matrix
|
||||
run: php .github/nightly_matrix.php "${{ github.event_name }}" "${{ github.run_attempt }}"
|
||||
run: php .github/nightly_matrix.php "${{ github.event_name }}" "${{ github.run_attempt }}" "${{ github.head_ref || github.ref_name }}"
|
||||
- name: Notify Slack
|
||||
if: failure()
|
||||
uses: ./.github/actions/notify-slack
|
||||
with:
|
||||
token: ${{ secrets.ACTION_MONITORING_SLACK }}
|
||||
ALPINE:
|
||||
needs: GENERATE_MATRIX
|
||||
if: ${{ needs.GENERATE_MATRIX.outputs.branches != '[]' }}
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
include: ${{ fromJson(needs.GENERATE_MATRIX.outputs.alpine-matrix-include) }}
|
||||
name: "${{ matrix.branch.name }}_ALPINE_X64${{ matrix.name }}_${{ matrix.debug && 'DEBUG' || 'RELEASE' }}_${{ matrix.zts && 'ZTS' || 'NTS' }}"
|
||||
runs-on: ubuntu-22.04
|
||||
container:
|
||||
image: 'alpine:3.20.1'
|
||||
steps:
|
||||
- name: git checkout
|
||||
uses: actions/checkout@v4
|
||||
with:
|
||||
ref: ${{ matrix.branch.ref }}
|
||||
- name: apk
|
||||
uses: ./.github/actions/apk
|
||||
- name: LLVM 17 (ASAN-only)
|
||||
if: ${{ matrix.asan }}
|
||||
# libclang_rt.asan-x86_64.a is provided by compiler-rt, and only for clang17:
|
||||
# https://pkgs.alpinelinux.org/contents?file=libclang_rt.asan-x86_64.a&path=&name=&branch=v3.20
|
||||
run: |
|
||||
apk add clang17 compiler-rt
|
||||
- name: System info
|
||||
run: |
|
||||
echo "::group::Show host CPU info"
|
||||
lscpu
|
||||
echo "::endgroup::"
|
||||
echo "::group::Show installed package versions"
|
||||
apk list
|
||||
echo "::endgroup::"
|
||||
- name: ./configure
|
||||
uses: ./.github/actions/configure-alpine
|
||||
with:
|
||||
configurationParameters: >-
|
||||
${{ matrix.configuration_parameters }}
|
||||
--${{ matrix.debug && 'enable' || 'disable' }}-debug
|
||||
--${{ matrix.zts && 'enable' || 'disable' }}-zts
|
||||
skipSlow: ${{ matrix.asan }}
|
||||
- name: make
|
||||
run: make -j$(/usr/bin/nproc) >/dev/null
|
||||
- name: make install
|
||||
uses: ./.github/actions/install-alpine
|
||||
- name: Test Tracing JIT
|
||||
if: matrix.test_jit
|
||||
uses: ./.github/actions/test-alpine
|
||||
with:
|
||||
jitType: tracing
|
||||
runTestsParameters: >-
|
||||
${{ matrix.run_tests_parameters }}
|
||||
-d zend_extension=opcache.so
|
||||
-d opcache.enable_cli=1
|
||||
- name: Notify Slack
|
||||
if: failure()
|
||||
uses: ./.github/actions/notify-slack
|
||||
with:
|
||||
token: ${{ secrets.ACTION_MONITORING_SLACK }}
|
||||
|
||||
LINUX_X64:
|
||||
needs: GENERATE_MATRIX
|
||||
if: ${{ needs.GENERATE_MATRIX.outputs.branches != '[]' }}
|
||||
@@ -55,6 +116,15 @@ jobs:
|
||||
POSTGRES_USER: postgres
|
||||
POSTGRES_PASSWORD: postgres
|
||||
POSTGRES_DB: test
|
||||
firebird:
|
||||
image: jacobalberty/firebird
|
||||
ports:
|
||||
- 3050:3050
|
||||
env:
|
||||
ISC_PASSWORD: test
|
||||
FIREBIRD_DATABASE: test.fdb
|
||||
FIREBIRD_USER: test
|
||||
FIREBIRD_PASSWORD: test
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
@@ -67,28 +137,18 @@ jobs:
|
||||
zts: [true, false]
|
||||
include: ${{ fromJson(needs.GENERATE_MATRIX.outputs.matrix-include) }}
|
||||
name: "${{ matrix.branch.name }}_LINUX_X64${{ matrix.name }}_${{ matrix.debug && 'DEBUG' || 'RELEASE' }}_${{ matrix.zts && 'ZTS' || 'NTS' }}"
|
||||
runs-on: ubuntu-${{ (matrix.branch.ref == 'PHP-8.3' || matrix.branch.ref == 'master') && '22.04' || '20.04' }}
|
||||
runs-on: ubuntu-${{ (matrix.branch.version.minor >= 3 && !matrix.asan) && '22.04' || '20.04' }}
|
||||
steps:
|
||||
# https://stackoverflow.com/a/76921482/1320374
|
||||
- name: Increase swapfile
|
||||
if: matrix.asan
|
||||
run: |
|
||||
sudo swapoff -a
|
||||
sudo fallocate -l 8G /swapfile
|
||||
sudo chmod 600 /swapfile
|
||||
sudo mkswap /swapfile
|
||||
sudo swapon /swapfile
|
||||
sudo swapon --show
|
||||
- name: git checkout
|
||||
uses: actions/checkout@v4
|
||||
with:
|
||||
ref: ${{ matrix.branch.ref }}
|
||||
- name: Create MSSQL container
|
||||
uses: ./.github/actions/setup-mssql
|
||||
- name: Create Oracle container
|
||||
uses: ./.github/actions/setup-oracle
|
||||
- name: apt
|
||||
uses: ./.github/actions/apt-x64
|
||||
with:
|
||||
asan: ${{ matrix.asan && 'true' || 'false' }}
|
||||
- name: System info
|
||||
run: |
|
||||
echo "::group::Show host CPU info"
|
||||
@@ -104,6 +164,7 @@ jobs:
|
||||
${{ matrix.configuration_parameters }}
|
||||
--${{ matrix.debug && 'enable' || 'disable' }}-debug
|
||||
--${{ matrix.zts && 'enable' || 'disable' }}-zts
|
||||
asan: ${{ matrix.asan && 'true' || 'false' }}
|
||||
- name: make
|
||||
run: make -j$(/usr/bin/nproc) >/dev/null
|
||||
- name: make install
|
||||
@@ -161,7 +222,7 @@ jobs:
|
||||
name: "${{ matrix.branch.name }}_LINUX_X32_${{ matrix.debug && 'DEBUG' || 'RELEASE' }}_${{ matrix.zts && 'ZTS' || 'NTS' }}"
|
||||
runs-on: ubuntu-latest
|
||||
container:
|
||||
image: ubuntu:${{ (matrix.branch.ref == 'PHP-8.3' || matrix.branch.ref == 'master') && '22.04' || '20.04' }}
|
||||
image: ubuntu:${{ matrix.branch.version.minor >= 3 && '22.04' || '20.04' }}
|
||||
services:
|
||||
mysql:
|
||||
image: mysql:8.3
|
||||
@@ -234,11 +295,9 @@ jobs:
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
branch: ${{ fromJson(needs.GENERATE_MATRIX.outputs.branches) }}
|
||||
debug: [true, false]
|
||||
zts: [true, false]
|
||||
name: "${{ matrix.branch.name }}_MACOS_${{ matrix.debug && 'DEBUG' || 'RELEASE' }}_${{ matrix.zts && 'ZTS' || 'NTS' }}"
|
||||
runs-on: macos-13
|
||||
include: ${{ fromJson(needs.GENERATE_MATRIX.outputs.macos-matrix-include) }}
|
||||
name: "${{ matrix.branch.name }}_MACOS_${{ matrix.arch }}_${{ matrix.debug && 'DEBUG' || 'RELEASE' }}_${{ matrix.zts && 'ZTS' || 'NTS' }}"
|
||||
runs-on: macos-${{ matrix.os }}
|
||||
steps:
|
||||
- name: git checkout
|
||||
uses: actions/checkout@v4
|
||||
@@ -254,35 +313,34 @@ jobs:
|
||||
--${{ matrix.zts && 'enable' || 'disable' }}-zts
|
||||
- name: make
|
||||
run: |-
|
||||
export PATH="/usr/local/opt/bison/bin:$PATH"
|
||||
export PATH="$(brew --prefix)/opt/bison/bin:$PATH"
|
||||
make -j$(sysctl -n hw.logicalcpu) >/dev/null
|
||||
- name: make install
|
||||
run: sudo make install
|
||||
- name: Test
|
||||
uses: ./.github/actions/test-macos
|
||||
- name: Test Tracing JIT
|
||||
if: matrix.test_jit
|
||||
uses: ./.github/actions/test-macos
|
||||
with:
|
||||
jitType: tracing
|
||||
runTestsParameters: >-
|
||||
-d zend_extension=opcache.so
|
||||
-d opcache.enable_cli=1
|
||||
-d opcache.protect_memory=1
|
||||
- name: Test OpCache
|
||||
uses: ./.github/actions/test-macos
|
||||
with:
|
||||
runTestsParameters: >-
|
||||
-d zend_extension=opcache.so
|
||||
-d opcache.enable_cli=1
|
||||
-d opcache.protect_memory=1
|
||||
- name: Test Function JIT
|
||||
if: matrix.test_jit
|
||||
uses: ./.github/actions/test-macos
|
||||
with:
|
||||
jitType: function
|
||||
runTestsParameters: >-
|
||||
-d zend_extension=opcache.so
|
||||
-d opcache.enable_cli=1
|
||||
-d opcache.protect_memory=1
|
||||
- name: Verify generated files are up to date
|
||||
uses: ./.github/actions/verify-generated-files
|
||||
- name: Notify Slack
|
||||
@@ -291,7 +349,7 @@ jobs:
|
||||
with:
|
||||
token: ${{ secrets.ACTION_MONITORING_SLACK }}
|
||||
COVERAGE_DEBUG_NTS:
|
||||
if: github.repository_owner == 'php' || github.event_name == 'workflow_dispatch'
|
||||
if: github.repository == 'php/php-src' || github.event_name == 'workflow_dispatch'
|
||||
services:
|
||||
mysql:
|
||||
image: mysql:8.3
|
||||
@@ -306,6 +364,15 @@ jobs:
|
||||
POSTGRES_USER: postgres
|
||||
POSTGRES_PASSWORD: postgres
|
||||
POSTGRES_DB: test
|
||||
firebird:
|
||||
image: jacobalberty/firebird
|
||||
ports:
|
||||
- 3050:3050
|
||||
env:
|
||||
ISC_PASSWORD: test
|
||||
FIREBIRD_DATABASE: test.fdb
|
||||
FIREBIRD_USER: test
|
||||
FIREBIRD_PASSWORD: test
|
||||
runs-on: ubuntu-22.04
|
||||
steps:
|
||||
- name: git checkout
|
||||
@@ -330,12 +397,16 @@ jobs:
|
||||
- name: Test OpCache
|
||||
uses: ./.github/actions/test-linux
|
||||
with:
|
||||
jitType: tracing
|
||||
runTestsParameters: >-
|
||||
-d zend_extension=opcache.so
|
||||
-d opcache.enable_cli=1
|
||||
- name: Upload Test Coverage to Codecov.io
|
||||
- uses: codecov/codecov-action@v4
|
||||
if: always()
|
||||
run: bash <(curl -s https://codecov.io/bash)
|
||||
with:
|
||||
fail_ci_if_error: true
|
||||
token: ${{ secrets.CODECOV_TOKEN }}
|
||||
verbose: true
|
||||
- name: Notify Slack
|
||||
if: failure()
|
||||
uses: ./.github/actions/notify-slack
|
||||
@@ -348,9 +419,16 @@ jobs:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
branch: ${{ fromJson(needs.GENERATE_MATRIX.outputs.branches) }}
|
||||
name: "${{ matrix.branch.name }}_COMMUNITY"
|
||||
runs-on: ubuntu-${{ (matrix.branch.ref == 'PHP-8.3' || matrix.branch.ref == 'master') && '22.04' || '20.04' }}
|
||||
type: ['asan', 'verify_type_inference']
|
||||
# These branches don't include type verification
|
||||
exclude:
|
||||
- { branch: { name: 'PHP-8.1', ref: 'PHP-8.1', major: 8, minor: 1 }, type: 'verify_type_inference' }
|
||||
- { branch: { name: 'PHP-8.2', ref: 'PHP-8.2', major: 8, minor: 2 }, type: 'verify_type_inference' }
|
||||
- { branch: { name: 'PHP-8.3', ref: 'PHP-8.3', major: 8, minor: 3 }, type: 'verify_type_inference' }
|
||||
name: "${{ matrix.branch.name }}_COMMUNITY_${{ matrix.type }}"
|
||||
runs-on: ubuntu-${{ matrix.branch.version.minor >= 3 && '22.04' || '20.04' }}
|
||||
env:
|
||||
ASAN_OPTIONS: exitcode=139
|
||||
UBSAN_OPTIONS: print_stacktrace=1
|
||||
USE_ZEND_ALLOC: 0
|
||||
USE_TRACKED_ALLOC: 1
|
||||
@@ -364,11 +442,11 @@ jobs:
|
||||
- name: ./configure
|
||||
uses: ./.github/actions/configure-x64
|
||||
with:
|
||||
# CFLAGS removes O2, so we have to add it again...
|
||||
configurationParameters: >-
|
||||
--enable-debug
|
||||
--enable-zts
|
||||
CFLAGS='-fsanitize=undefined,address -fno-sanitize-recover -DZEND_TRACK_ARENA_ALLOC'
|
||||
LDFLAGS='-fsanitize=undefined,address'
|
||||
${{ matrix.type == 'asan' && '--enable-debug CFLAGS="-fsanitize=undefined,address -fno-sanitize-recover -DZEND_TRACK_ARENA_ALLOC" LDFLAGS="-fsanitize=undefined,address"' || '' }}
|
||||
${{ matrix.type == 'verify_type_inference' && 'CFLAGS="-DZEND_VERIFY_TYPE_INFERENCE -O2"' || '' }}
|
||||
- name: make
|
||||
run: make -j$(/usr/bin/nproc) >/dev/null
|
||||
- name: make install
|
||||
@@ -378,14 +456,32 @@ jobs:
|
||||
sudo service mysql start
|
||||
mysql -uroot -proot -e "CREATE DATABASE IF NOT EXISTS test"
|
||||
mysql -uroot -proot -e "SET GLOBAL local_infile = true"
|
||||
- name: Enable Opcache and JIT
|
||||
- name: Enable Opcache
|
||||
run: |
|
||||
echo memory_limit=-1 >> /etc/php.d/opcache.ini
|
||||
echo zend_extension=opcache.so > /etc/php.d/opcache.ini
|
||||
echo opcache.enable_cli=1 >> /etc/php.d/opcache.ini
|
||||
echo opcache.enable=1 >> /etc/php.d/opcache.ini
|
||||
echo opcache.protect_memory=1 >> /etc/php.d/opcache.ini
|
||||
echo opcache.memory_consumption=256M >> /etc/php.d/opcache.ini
|
||||
echo opcache.file_update_protection=0 >> /etc/php.d/opcache.ini
|
||||
echo opcache.interned_strings_buffer=64 >> /etc/php.d/opcache.ini
|
||||
echo opcache.max_accelerated_files=100000 >> /etc/php.d/opcache.ini
|
||||
- name: Enable JIT
|
||||
if: matrix.type != 'verify_type_inference'
|
||||
run: |
|
||||
echo opcache.jit=tracing >> /etc/php.d/opcache.ini
|
||||
echo opcache.jit_buffer_size=1G >> /etc/php.d/opcache.ini
|
||||
echo opcache.jit_max_root_traces=100000 >> /etc/php.d/opcache.ini
|
||||
echo opcache.jit_max_side_traces=100000 >> /etc/php.d/opcache.ini
|
||||
echo opcache.jit_max_exit_counters=100000 >> /etc/php.d/opcache.ini
|
||||
echo opcache.jit_hot_loop=1 >> /etc/php.d/opcache.ini
|
||||
echo opcache.jit_hot_func=1 >> /etc/php.d/opcache.ini
|
||||
echo opcache.jit_hot_return=1 >> /etc/php.d/opcache.ini
|
||||
echo opcache.jit_hot_side_exit=1 >> /etc/php.d/opcache.ini
|
||||
php -v
|
||||
- name: Test AMPHP
|
||||
if: matrix.branch.ref != 'PHP-8.0'
|
||||
if: always()
|
||||
run: |
|
||||
repositories="amp cache dns file http parallel parser pipeline process serialization socket sync websocket-client websocket-server"
|
||||
X=0
|
||||
@@ -395,7 +491,6 @@ jobs:
|
||||
cd "amphp-$repository"
|
||||
git rev-parse HEAD
|
||||
php /usr/bin/composer install --no-progress --ignore-platform-reqs
|
||||
export ASAN_OPTIONS=exitcode=139
|
||||
vendor/bin/phpunit || EXIT_CODE=$?
|
||||
if [ ${EXIT_CODE:-0} -gt 128 ]; then
|
||||
X=1;
|
||||
@@ -404,7 +499,7 @@ jobs:
|
||||
done
|
||||
exit $X
|
||||
- name: Test Laravel
|
||||
if: matrix.branch.ref != 'PHP-8.0'
|
||||
if: always()
|
||||
run: |
|
||||
git clone https://github.com/laravel/framework.git --branch=master --depth=1
|
||||
cd framework
|
||||
@@ -412,13 +507,12 @@ jobs:
|
||||
php /usr/bin/composer install --no-progress --ignore-platform-reqs
|
||||
# Hack to disable a test that hangs
|
||||
php -r '$c = file_get_contents("tests/Filesystem/FilesystemTest.php"); $c = str_replace("public function testSharedGet()", "#[\\PHPUnit\\Framework\\Attributes\\Group('"'"'skip'"'"')]\n public function testSharedGet()", $c); file_put_contents("tests/Filesystem/FilesystemTest.php", $c);'
|
||||
export ASAN_OPTIONS=exitcode=139
|
||||
php vendor/bin/phpunit --exclude-group skip || EXIT_CODE=$?
|
||||
if [ ${EXIT_CODE:-0} -gt 128 ]; then
|
||||
exit 1
|
||||
fi
|
||||
- name: Test ReactPHP
|
||||
if: matrix.branch.ref != 'PHP-8.0'
|
||||
if: always()
|
||||
run: |
|
||||
repositories="async cache child-process datagram dns event-loop promise promise-stream promise-timer stream"
|
||||
X=0
|
||||
@@ -428,7 +522,6 @@ jobs:
|
||||
cd "reactphp-$repository"
|
||||
git rev-parse HEAD
|
||||
php /usr/bin/composer install --no-progress --ignore-platform-reqs
|
||||
export ASAN_OPTIONS=exitcode=139
|
||||
vendor/bin/phpunit || EXIT_CODE=$?
|
||||
if [ $[EXIT_CODE:-0} -gt 128 ]; then
|
||||
X=1;
|
||||
@@ -437,19 +530,18 @@ jobs:
|
||||
done
|
||||
exit $X
|
||||
- name: Test Revolt PHP
|
||||
if: matrix.branch.ref != 'PHP-8.0'
|
||||
if: always()
|
||||
run: |
|
||||
git clone https://github.com/revoltphp/event-loop.git --depth=1
|
||||
cd event-loop
|
||||
git rev-parse HEAD
|
||||
php /usr/bin/composer install --no-progress --ignore-platform-reqs
|
||||
export ASAN_OPTIONS=exitcode=139
|
||||
vendor/bin/phpunit || EXIT_CODE=$?
|
||||
if [ ${EXIT_CODE:-0} -gt 128 ]; then
|
||||
exit 1
|
||||
fi
|
||||
- name: Test Symfony
|
||||
if: matrix.branch.ref != 'PHP-8.0'
|
||||
if: always()
|
||||
run: |
|
||||
git clone https://github.com/symfony/symfony.git --depth=1
|
||||
cd symfony
|
||||
@@ -460,7 +552,6 @@ jobs:
|
||||
php -r '$c = file_get_contents("src/Symfony/Component/HtmlSanitizer/Tests/HtmlSanitizerCustomTest.php"); $c = str_replace("public function testSanitizeDeepNestedString()", "/** @group skip */\n public function testSanitizeDeepNestedString()", $c); file_put_contents("src/Symfony/Component/HtmlSanitizer/Tests/HtmlSanitizerCustomTest.php", $c);'
|
||||
# Buggy FFI test in Symfony, see https://github.com/symfony/symfony/issues/47668
|
||||
php -r '$c = file_get_contents("src/Symfony/Component/VarDumper/Tests/Caster/FFICasterTest.php"); $c = str_replace("public function testCastNonTrailingCharPointer()", "/** @group skip */\n public function testCastNonTrailingCharPointer()", $c); file_put_contents("src/Symfony/Component/VarDumper/Tests/Caster/FFICasterTest.php", $c);'
|
||||
export ASAN_OPTIONS=exitcode=139
|
||||
export SYMFONY_DEPRECATIONS_HELPER=max[total]=999
|
||||
X=0
|
||||
for component in $(find src/Symfony -mindepth 2 -type f -name phpunit.xml.dist -printf '%h\n'); do
|
||||
@@ -476,14 +567,13 @@ jobs:
|
||||
git clone https://github.com/sebastianbergmann/phpunit.git --branch=main --depth=1
|
||||
cd phpunit
|
||||
git rev-parse HEAD
|
||||
export ASAN_OPTIONS=exitcode=139
|
||||
php /usr/bin/composer install --no-progress --ignore-platform-reqs
|
||||
php ./phpunit || EXIT_CODE=$?
|
||||
if [ ${EXIT_CODE:-0} -gt 128 ]; then
|
||||
exit 1
|
||||
fi
|
||||
- name: 'Symfony Preloading'
|
||||
if: matrix.branch.ref != 'PHP-8.0'
|
||||
if: always()
|
||||
run: |
|
||||
php /usr/bin/composer create-project symfony/symfony-demo symfony_demo --no-progress --ignore-platform-reqs
|
||||
cd symfony_demo
|
||||
@@ -496,7 +586,6 @@ jobs:
|
||||
git clone https://github.com/WordPress/wordpress-develop.git wordpress --depth=1
|
||||
cd wordpress
|
||||
git rev-parse HEAD
|
||||
export ASAN_OPTIONS=exitcode=139
|
||||
php /usr/bin/composer install --no-progress --ignore-platform-reqs
|
||||
cp wp-tests-config-sample.php wp-tests-config.php
|
||||
sed -i 's/youremptytestdbnamehere/test/g' wp-tests-config.php
|
||||
@@ -528,12 +617,21 @@ jobs:
|
||||
POSTGRES_USER: postgres
|
||||
POSTGRES_PASSWORD: postgres
|
||||
POSTGRES_DB: test
|
||||
firebird:
|
||||
image: jacobalberty/firebird
|
||||
ports:
|
||||
- 3050:3050
|
||||
env:
|
||||
ISC_PASSWORD: test
|
||||
FIREBIRD_DATABASE: test.fdb
|
||||
FIREBIRD_USER: test
|
||||
FIREBIRD_PASSWORD: test
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
branch: ${{ fromJson(needs.GENERATE_MATRIX.outputs.branches) }}
|
||||
name: "${{ matrix.branch.name }}_OPCACHE_VARIATION"
|
||||
runs-on: ubuntu-${{ (matrix.branch.ref == 'PHP-8.3' || matrix.branch.ref == 'master') && '22.04' || '20.04' }}
|
||||
runs-on: ubuntu-${{ matrix.branch.version.minor >= 3 && '22.04' || '20.04' }}
|
||||
steps:
|
||||
- name: git checkout
|
||||
uses: actions/checkout@v4
|
||||
@@ -541,8 +639,6 @@ jobs:
|
||||
ref: ${{ matrix.branch.ref }}
|
||||
- name: Create MSSQL container
|
||||
uses: ./.github/actions/setup-mssql
|
||||
- name: Create Oracle container
|
||||
uses: ./.github/actions/setup-oracle
|
||||
- name: apt
|
||||
uses: ./.github/actions/apt-x64
|
||||
- name: ./configure
|
||||
@@ -609,7 +705,7 @@ jobs:
|
||||
matrix:
|
||||
branch: ${{ fromJson(needs.GENERATE_MATRIX.outputs.branches) }}
|
||||
name: "${{ matrix.branch.name }}_MSAN"
|
||||
runs-on: ubuntu-${{ (matrix.branch.ref == 'PHP-8.3' || matrix.branch.ref == 'master') && '22.04' || '20.04' }}
|
||||
runs-on: ubuntu-${{ matrix.branch.version.minor >= 3 && '22.04' || '20.04' }}
|
||||
steps:
|
||||
- name: git checkout
|
||||
uses: actions/checkout@v4
|
||||
@@ -662,7 +758,7 @@ jobs:
|
||||
--enable-memory-sanitizer \
|
||||
--with-config-file-path=/etc \
|
||||
--with-config-file-scan-dir=/etc/php.d \
|
||||
${{ matrix.branch.ref != 'PHP-8.0' && '--enable-dl-test=shared' || '' }}
|
||||
--enable-dl-test=shared
|
||||
- name: make
|
||||
run: make -j$(/usr/bin/nproc) >/dev/null
|
||||
- name: make install
|
||||
@@ -706,10 +802,8 @@ jobs:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
branch: ${{ fromJson(needs.GENERATE_MATRIX.outputs.branches) }}
|
||||
exclude:
|
||||
- branch: { name: 'PHP-80', ref: 'PHP-8.0' }
|
||||
name: "${{ matrix.branch.name }}_LIBMYSQLCLIENT"
|
||||
runs-on: ubuntu-${{ (matrix.branch.ref == 'PHP-8.3' || matrix.branch.ref == 'master') && '22.04' || '20.04' }}
|
||||
runs-on: ubuntu-${{ matrix.branch.version.minor >= 3 && '22.04' || '20.04' }}
|
||||
steps:
|
||||
- name: git checkout
|
||||
uses: actions/checkout@v4
|
||||
@@ -725,33 +819,26 @@ jobs:
|
||||
mysql -uroot -proot -e "CREATE DATABASE IF NOT EXISTS test"
|
||||
# Ensure local_infile tests can run.
|
||||
mysql -uroot -proot -e "SET GLOBAL local_infile = true"
|
||||
# Does not support caching_sha2_auth :(
|
||||
# - name: Build mysql-5.6
|
||||
# uses: ./.github/actions/build-libmysqlclient
|
||||
# with:
|
||||
# libmysql: mysql-5.6.49-linux-glibc2.12-x86_64.tar.gz
|
||||
# - name: Test mysql-5.6
|
||||
# uses: ./.github/actions/test-libmysqlclient
|
||||
- name: Build mysql-5.7
|
||||
uses: ./.github/actions/build-libmysqlclient
|
||||
with:
|
||||
libmysql: mysql-5.7.44-linux-glibc2.12-x86_64.tar.gz
|
||||
withMysqli: ${{ matrix.branch.ref == 'PHP-8.1' }}
|
||||
- name: Test mysql-5.7
|
||||
uses: ./.github/actions/test-libmysqlclient
|
||||
with:
|
||||
withMysqli: ${{ matrix.branch.ref == 'PHP-8.1' }}
|
||||
- name: Build mysql-8.0
|
||||
uses: ./.github/actions/build-libmysqlclient
|
||||
with:
|
||||
# FIXME: There are new warnings
|
||||
# configurationParameters: --enable-werror
|
||||
libmysql: mysql-8.0.33-linux-glibc2.12-x86_64.tar.xz
|
||||
configurationParameters: --enable-werror
|
||||
libmysql: mysql-8.0.37-linux-glibc2.28-x86_64.tar.xz
|
||||
withMysqli: ${{ matrix.branch.ref == 'PHP-8.1' }}
|
||||
- name: Test mysql-8.0
|
||||
uses: ./.github/actions/test-libmysqlclient
|
||||
with:
|
||||
withMysqli: ${{ matrix.branch.ref == 'PHP-8.1' }}
|
||||
- name: Build mysql-8.4
|
||||
uses: ./.github/actions/build-libmysqlclient
|
||||
with:
|
||||
configurationParameters: --enable-werror
|
||||
libmysql: mysql-8.4.0-linux-glibc2.28-x86_64.tar.xz
|
||||
withMysqli: ${{ matrix.branch.ref == 'PHP-8.1' }}
|
||||
- name: Test mysql-8.4
|
||||
uses: ./.github/actions/test-libmysqlclient
|
||||
with:
|
||||
withMysqli: ${{ matrix.branch.ref == 'PHP-8.1' }}
|
||||
- name: Verify generated files are up to date
|
||||
uses: ./.github/actions/verify-generated-files
|
||||
- name: Notify Slack
|
||||
@@ -760,7 +847,7 @@ jobs:
|
||||
with:
|
||||
token: ${{ secrets.ACTION_MONITORING_SLACK }}
|
||||
PECL:
|
||||
if: github.repository_owner == 'php' || github.event_name == 'workflow_dispatch'
|
||||
if: github.repository == 'php/php-src' || github.event_name == 'workflow_dispatch'
|
||||
runs-on: ubuntu-22.04
|
||||
env:
|
||||
CC: ccache gcc
|
||||
@@ -791,6 +878,7 @@ jobs:
|
||||
repository: phpredis/phpredis
|
||||
path: redis
|
||||
- name: git checkout xdebug
|
||||
if: false
|
||||
uses: actions/checkout@v4
|
||||
with:
|
||||
repository: xdebug/xdebug
|
||||
@@ -852,6 +940,7 @@ jobs:
|
||||
./configure --prefix=/opt/php --with-php-config=/opt/php/bin/php-config
|
||||
make -j$(/usr/bin/nproc)
|
||||
- name: build xdebug
|
||||
if: false
|
||||
run: |
|
||||
cd xdebug
|
||||
/opt/php/bin/phpize
|
||||
@@ -876,13 +965,13 @@ jobs:
|
||||
matrix:
|
||||
include: ${{ fromJson(needs.GENERATE_MATRIX.outputs.windows-matrix-include) }}
|
||||
name: "${{ matrix.branch.name }}_WINDOWS_${{ matrix.x64 && 'X64' || 'X86' }}_${{ matrix.zts && 'ZTS' || 'NTS' }}"
|
||||
runs-on: windows-2019
|
||||
runs-on: ${{ (matrix.branch.version.minor >= 4) && 'windows-2022' || 'windows-2019' }}
|
||||
env:
|
||||
PHP_BUILD_CACHE_BASE_DIR: C:\build-cache
|
||||
PHP_BUILD_OBJ_DIR: C:\obj
|
||||
PHP_BUILD_CACHE_SDK_DIR: C:\build-cache\sdk
|
||||
PHP_BUILD_SDK_BRANCH: php-sdk-2.3.0
|
||||
PHP_BUILD_CRT: vs16
|
||||
PHP_BUILD_CRT: ${{ (matrix.branch.version.minor >= 4) && 'vs17' || 'vs16' }}
|
||||
PLATFORM: ${{ matrix.x64 && 'x64' || 'x86' }}
|
||||
THREAD_SAFE: "${{ matrix.zts && '1' || '0' }}"
|
||||
INTRINSICS: "${{ matrix.zts && 'AVX2' || '' }}"
|
||||
|
||||
Reference in New Issue
Block a user