Commit 436000755b9 for php.net
commit 436000755b9d4d1e383352fae8f5bcc35520a111
Author: Ilija Tovilo <ilija.tovilo@me.com>
Date: Wed Feb 18 15:37:00 2026 +0100
Move benchmarking job to nightly
Then we can unify root.yml and push.yml.
Closes GH-21249
diff --git a/.github/nightly_matrix.php b/.github/nightly_matrix.php
index acb27a5cfc1..51dd2e69074 100644
--- a/.github/nightly_matrix.php
+++ b/.github/nightly_matrix.php
@@ -46,10 +46,11 @@ function get_current_version(): array {
return [$major, $minor];
}
-function select_jobs($nightly, $labels, $php_version, $ref, $all_variations) {
+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;
$test_alpine = in_array('CI: Alpine', $labels, true);
+ $test_benchmarking = in_array('CI: Benchmarking', $labels, true);
$test_community = in_array('CI: Community', $labels, true);
$test_coverage = in_array('CI: COVERAGE', $labels, true);
$test_freebsd = in_array('CI: FreeBSD', $labels, true);
@@ -67,6 +68,13 @@ function select_jobs($nightly, $labels, $php_version, $ref, $all_variations) {
if (version_compare($php_version, '8.4', '>=') && ($all_jobs || !$no_jobs || $test_alpine)) {
$jobs['ALPINE'] = true;
}
+ if (version_compare($php_version, '8.4', '>=')
+ && !$nightly
+ && ($all_jobs || !$no_jobs || $test_benchmarking)
+ // push trigger is restricted to official repository.
+ && ($repository === 'php/php-src' || $trigger === 'pull_request')) {
+ $jobs['BENCHMARKING'] = true;
+ }
if ($all_jobs || $test_community) {
$jobs['COMMUNITY']['matrix'] = version_compare($php_version, '8.4', '>=')
? ['type' => ['asan', 'verify_type_inference']]
@@ -162,9 +170,11 @@ function select_jobs($nightly, $labels, $php_version, $ref, $all_variations) {
$nightly = $trigger === 'schedule' || $trigger === 'workflow_dispatch';
$all_variations = $nightly || in_array('CI: All variations', $labels, true);
+$repository = $argv[5] ?? null;
+
foreach ($branches as &$branch) {
$php_version = $branch['version'][0] . '.' . $branch['version'][1];
- $branch['jobs'] = select_jobs($nightly, $labels, $php_version, $branch['ref'], $all_variations);
+ $branch['jobs'] = select_jobs($repository, $trigger, $nightly, $labels, $php_version, $branch['ref'], $all_variations);
$branch['config']['ubuntu_version'] = version_compare($php_version, '8.5', '>=') ? '24.04' : '22.04';
}
diff --git a/.github/workflows/nightly.yml b/.github/workflows/nightly.yml
index 4fffc701f92..6fd84455512 100644
--- a/.github/workflows/nightly.yml
+++ b/.github/workflows/nightly.yml
@@ -964,3 +964,106 @@ jobs:
configurationParameters: >-
--${{ matrix.zts && 'enable' || 'disable' }}-zts
runExtraTests: true
+ BENCHMARKING:
+ name: BENCHMARKING
+ if: ${{ fromJson(inputs.branch).jobs.BENCHMARKING }}
+ runs-on: ubuntu-${{ fromJson(inputs.branch).config.ubuntu_version }}
+ timeout-minutes: 50
+ steps:
+ - name: git checkout
+ uses: actions/checkout@v6
+ with:
+ fetch-depth: 0
+ # ASLR can cause a lot of noise due to missed sse opportunities for memcpy
+ # and other operations, so we disable it during benchmarking.
+ - name: Disable ASLR
+ run: echo 0 | sudo tee /proc/sys/kernel/randomize_va_space
+ - name: apt
+ run: |
+ set -x
+ sudo apt-get update
+ sudo apt-get install \
+ bison \
+ libgmp-dev \
+ libonig-dev \
+ libsqlite3-dev \
+ openssl \
+ re2c \
+ valgrind
+ - name: ccache
+ uses: ./.github/actions/ccache
+ with:
+ name: "${{ github.job }}"
+ - name: ./configure
+ run: |
+ set -x
+ ./buildconf --force
+ ./configure \
+ --disable-debug \
+ --enable-mbstring \
+ --enable-option-checking=fatal \
+ --enable-sockets \
+ --enable-werror \
+ --prefix=/usr \
+ --with-config-file-scan-dir=/etc/php.d \
+ --with-gmp \
+ --with-mysqli=mysqlnd \
+ --with-openssl \
+ --with-pdo-sqlite \
+ --with-valgrind
+ - name: make
+ run: make -j$(/usr/bin/nproc) >/dev/null
+ - name: make install
+ run: |
+ set -x
+ sudo make install
+ sudo mkdir -p /etc/php.d
+ sudo chmod 777 /etc/php.d
+ echo mysqli.default_socket=/var/run/mysqld/mysqld.sock > /etc/php.d/mysqli.ini
+ echo opcache.enable=1 >> /etc/php.d/opcache.ini
+ echo opcache.enable_cli=1 >> /etc/php.d/opcache.ini
+ - name: Setup
+ run: |
+ git config --global user.name "Benchmark"
+ git config --global user.email "benchmark@php.net"
+ sudo service mysql start
+ mysql -uroot -proot -e "CREATE DATABASE IF NOT EXISTS wordpress"
+ mysql -uroot -proot -e "CREATE USER 'wordpress'@'localhost' IDENTIFIED BY 'wordpress'; FLUSH PRIVILEGES;"
+ mysql -uroot -proot -e "GRANT ALL PRIVILEGES ON *.* TO 'wordpress'@'localhost' WITH GRANT OPTION;"
+ - name: git checkout benchmarking-data
+ uses: actions/checkout@v6
+ with:
+ repository: php/benchmarking-data
+ ssh-key: ${{ secrets.BENCHMARKING_DATA_DEPLOY_KEY }}
+ path: benchmark/repos/data
+ - name: Benchmark
+ run: php benchmark/benchmark.php true
+ - name: Store result
+ if: github.event_name == 'push'
+ run: |
+ set -x
+ cd benchmark/repos/data
+ git pull --autostash
+ if [ -e ".git/MERGE_HEAD" ]; then
+ echo "Merging, can't proceed"
+ exit 1
+ fi
+ git add .
+ if git diff --cached --quiet; then
+ exit 0
+ fi
+ git commit -m "Add result for ${{ github.repository }}@${{ github.sha }}"
+ git push
+ - name: Show diff
+ if: github.event_name == 'pull_request'
+ run: |-
+ set -x
+ php benchmark/generate_diff.php \
+ ${{ github.sha }} \
+ $(git merge-base ${{ github.event.pull_request.base.sha }} ${{ github.sha }}) \
+ > $GITHUB_STEP_SUMMARY
+ - uses: actions/upload-artifact@v6
+ with:
+ name: profiles
+ path: ${{ github.workspace }}/benchmark/profiles
+ retention-days: 30
diff --git a/.github/workflows/push.yml b/.github/workflows/push.yml
index 7f2bcf2ca9e..ccd82c546d9 100644
--- a/.github/workflows/push.yml
+++ b/.github/workflows/push.yml
@@ -42,7 +42,7 @@ jobs:
- uses: actions/checkout@v6
- name: Generate Matrix
id: set-matrix
- run: php .github/nightly_matrix.php "${{ github.event_name }}" "${{ github.run_attempt }}" "${{ github.ref }}" '${{ toJSON(github.event.pull_request.labels) }}'
+ run: php .github/nightly_matrix.php "${{ github.event_name }}" "${{ github.run_attempt }}" "${{ github.ref }}" '${{ toJSON(github.event.pull_request.labels) }}' "${{ github.repository }}"
PUSH:
needs: GENERATE_MATRIX
name: ${{ matrix.branch.ref }}
@@ -55,106 +55,3 @@ jobs:
all_variations: ${{ needs.GENERATE_MATRIX.outputs.all_variations == 'true' }}
branch: ${{ toJSON(matrix.branch) }}
secrets: inherit
- BENCHMARKING:
- name: BENCHMARKING
- if: github.repository == 'php/php-src' || github.event_name == 'pull_request'
- runs-on: ubuntu-24.04
- timeout-minutes: 50
- steps:
- - name: git checkout
- uses: actions/checkout@v6
- with:
- fetch-depth: 0
- # ASLR can cause a lot of noise due to missed sse opportunities for memcpy
- # and other operations, so we disable it during benchmarking.
- - name: Disable ASLR
- run: echo 0 | sudo tee /proc/sys/kernel/randomize_va_space
- - name: apt
- run: |
- set -x
- sudo apt-get update
- sudo apt-get install \
- bison \
- libgmp-dev \
- libonig-dev \
- libsqlite3-dev \
- openssl \
- re2c \
- valgrind
- - name: ccache
- uses: ./.github/actions/ccache
- with:
- name: "${{ github.job }}"
- - name: ./configure
- run: |
- set -x
- ./buildconf --force
- ./configure \
- --disable-debug \
- --enable-mbstring \
- --enable-option-checking=fatal \
- --enable-sockets \
- --enable-werror \
- --prefix=/usr \
- --with-config-file-scan-dir=/etc/php.d \
- --with-gmp \
- --with-mysqli=mysqlnd \
- --with-openssl \
- --with-pdo-sqlite \
- --with-valgrind
- - name: make
- run: make -j$(/usr/bin/nproc) >/dev/null
- - name: make install
- run: |
- set -x
- sudo make install
- sudo mkdir -p /etc/php.d
- sudo chmod 777 /etc/php.d
- echo mysqli.default_socket=/var/run/mysqld/mysqld.sock > /etc/php.d/mysqli.ini
- echo opcache.enable=1 >> /etc/php.d/opcache.ini
- echo opcache.enable_cli=1 >> /etc/php.d/opcache.ini
- - name: Setup
- run: |
- git config --global user.name "Benchmark"
- git config --global user.email "benchmark@php.net"
- sudo service mysql start
- mysql -uroot -proot -e "CREATE DATABASE IF NOT EXISTS wordpress"
- mysql -uroot -proot -e "CREATE USER 'wordpress'@'localhost' IDENTIFIED BY 'wordpress'; FLUSH PRIVILEGES;"
- mysql -uroot -proot -e "GRANT ALL PRIVILEGES ON *.* TO 'wordpress'@'localhost' WITH GRANT OPTION;"
- - name: git checkout benchmarking-data
- uses: actions/checkout@v6
- with:
- repository: php/benchmarking-data
- ssh-key: ${{ secrets.BENCHMARKING_DATA_DEPLOY_KEY }}
- path: benchmark/repos/data
- - name: Benchmark
- run: php benchmark/benchmark.php true
- - name: Store result
- if: github.event_name == 'push'
- run: |
- set -x
- cd benchmark/repos/data
- git pull --autostash
- if [ -e ".git/MERGE_HEAD" ]; then
- echo "Merging, can't proceed"
- exit 1
- fi
- git add .
- if git diff --cached --quiet; then
- exit 0
- fi
- git commit -m "Add result for ${{ github.repository }}@${{ github.sha }}"
- git push
- - name: Show diff
- if: github.event_name == 'pull_request'
- run: |-
- set -x
- php benchmark/generate_diff.php \
- ${{ github.sha }} \
- $(git merge-base ${{ github.event.pull_request.base.sha }} ${{ github.sha }}) \
- > $GITHUB_STEP_SUMMARY
- - uses: actions/upload-artifact@v6
- with:
- name: profiles
- path: ${{ github.workspace }}/benchmark/profiles
- retention-days: 30
diff --git a/.github/workflows/root.yml b/.github/workflows/root.yml
index 9a47d5ceec4..5b3ebfd11d5 100644
--- a/.github/workflows/root.yml
+++ b/.github/workflows/root.yml
@@ -31,7 +31,7 @@ jobs:
nightly-
- name: Generate Matrix
id: set-matrix
- run: php .github/nightly_matrix.php "${{ github.event_name }}" "${{ github.run_attempt }}" "${{ github.head_ref || github.ref_name }}" '[]'
+ run: php .github/nightly_matrix.php "${{ github.event_name }}" "${{ github.run_attempt }}" "${{ github.head_ref || github.ref_name }}" '[]' "${{ github.repository }}"
NIGHTLY:
needs: GENERATE_MATRIX
name: ${{ matrix.branch.ref }}