mirror of
https://github.com/php/php-src.git
synced 2026-03-24 08:12:21 +01:00
macOs CI update. since sonoma (14) had been released since few months, we could afford to upgrade to its previous release.
310 lines
10 KiB
YAML
310 lines
10 KiB
YAML
name: Push
|
|
on:
|
|
push:
|
|
paths-ignore:
|
|
- docs/*
|
|
- NEWS
|
|
- UPGRADING
|
|
- UPGRADING.INTERNALS
|
|
- '**/README.*'
|
|
- CONTRIBUTING.md
|
|
- CODING_STANDARDS.md
|
|
- .cirrus.yml
|
|
- .travis.yml
|
|
- travis/*
|
|
- .circleci/*
|
|
branches:
|
|
- PHP-7.4
|
|
- PHP-8.0
|
|
- PHP-8.1
|
|
- PHP-8.2
|
|
- PHP-8.3
|
|
- master
|
|
pull_request:
|
|
paths-ignore:
|
|
- docs/*
|
|
- NEWS
|
|
- UPGRADING
|
|
- UPGRADING.INTERNALS
|
|
- '**/README.*'
|
|
- CONTRIBUTING.md
|
|
- CODING_STANDARDS.md
|
|
- .cirrus.yml
|
|
- .travis.yml
|
|
- travis/*
|
|
- .circleci/*
|
|
branches:
|
|
- '**'
|
|
permissions:
|
|
contents: read
|
|
concurrency:
|
|
group: ${{ github.workflow }}-${{ github.event.pull_request.url || github.run_id }}
|
|
cancel-in-progress: true
|
|
env:
|
|
CC: ccache gcc
|
|
CXX: ccache g++
|
|
jobs:
|
|
LINUX_X64:
|
|
services:
|
|
mysql:
|
|
image: mysql:8
|
|
ports:
|
|
- 3306:3306
|
|
env:
|
|
MYSQL_DATABASE: test
|
|
MYSQL_ROOT_PASSWORD: root
|
|
postgres:
|
|
image: postgres
|
|
ports:
|
|
- 5432:5432
|
|
env:
|
|
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:
|
|
include:
|
|
- debug: false
|
|
zts: false
|
|
asan: false
|
|
- debug: true
|
|
zts: true
|
|
asan: true
|
|
name: "LINUX_X64_${{ matrix.debug && 'DEBUG' || 'RELEASE' }}_${{ matrix.zts && 'ZTS' || 'NTS' }}${{ matrix.asan && '_ASAN' || '' }}"
|
|
runs-on: ubuntu-22.04
|
|
steps:
|
|
- name: git checkout
|
|
uses: actions/checkout@v4
|
|
- name: apt
|
|
uses: ./.github/actions/apt-x64
|
|
- name: LLVM 16 (ASAN-only)
|
|
if: ${{ matrix.asan }}
|
|
run: |
|
|
wget https://apt.llvm.org/llvm.sh
|
|
chmod u+x llvm.sh
|
|
sudo ./llvm.sh 16
|
|
- name: System info
|
|
run: |
|
|
echo "::group::Show host CPU info"
|
|
lscpu
|
|
echo "::endgroup::"
|
|
echo "::group::Show installed package versions"
|
|
dpkg -l
|
|
echo "::endgroup::"
|
|
- name: Create MSSQL container
|
|
if: ${{ !matrix.asan }}
|
|
uses: ./.github/actions/setup-mssql
|
|
- name: Create Oracle container
|
|
if: ${{ !matrix.asan }}
|
|
uses: ./.github/actions/setup-oracle
|
|
- name: Setup Caddy server
|
|
uses: ./.github/actions/setup-caddy
|
|
- name: ccache
|
|
uses: hendrikmuhs/ccache-action@v1.2
|
|
with:
|
|
# This duplicates the "job.name" expression above because
|
|
# GitHub has no way to query the job name (github.job is the
|
|
# job id, not the job name)
|
|
key: "LINUX_X64_${{ matrix.debug && 'DEBUG' || 'RELEASE' }}_${{ matrix.zts && 'ZTS' || 'NTS' }}${{ matrix.asan && '_ASAN' || '' }}-${{hashFiles('main/php_version.h')}}"
|
|
append-timestamp: false
|
|
- name: ./configure
|
|
uses: ./.github/actions/configure-x64
|
|
with:
|
|
configurationParameters: >-
|
|
--${{ matrix.debug && 'enable' || 'disable' }}-debug
|
|
--${{ matrix.zts && 'enable' || 'disable' }}-zts
|
|
${{ matrix.asan && 'CFLAGS="-fsanitize=undefined,address -DZEND_TRACK_ARENA_ALLOC" LDFLAGS="-fsanitize=undefined,address" CC=clang-16 CXX=clang++-16 --disable-opcache-jit' || '' }}
|
|
skipSlow: ${{ matrix.asan }}
|
|
- name: make
|
|
run: make -j$(/usr/bin/nproc) >/dev/null
|
|
- name: make install
|
|
uses: ./.github/actions/install-linux
|
|
- name: Setup
|
|
if: ${{ !matrix.asan }}
|
|
uses: ./.github/actions/setup-x64
|
|
- name: Test
|
|
if: matrix.asan == false
|
|
uses: ./.github/actions/test-linux
|
|
with:
|
|
testArtifacts: ${{ matrix.debug && 'DEBUG' || 'RELEASE' }}_${{ matrix.zts && 'ZTS' || 'NTS' }}
|
|
- name: Test ${{ matrix.asan && 'OpCache' || 'Tracing JIT' }}
|
|
uses: ./.github/actions/test-linux
|
|
with:
|
|
testArtifacts: ${{ matrix.debug && 'DEBUG' || 'RELEASE' }}_${{ matrix.zts && 'ZTS' || 'NTS' }}${{ matrix.asan && '_ASAN' || '' }}_${{ matrix.asan && 'OpCache' || 'Tracing JIT' }}
|
|
jitType: ${{ matrix.asan && 'disable' || 'tracing' }}
|
|
runTestsParameters: >-
|
|
-d zend_extension=opcache.so
|
|
-d opcache.enable_cli=1
|
|
${{ matrix.asan && '--asan -x' || '' }}
|
|
- name: Verify generated files are up to date
|
|
if: ${{ !matrix.asan }}
|
|
uses: ./.github/actions/verify-generated-files
|
|
MACOS_DEBUG_NTS:
|
|
runs-on: macos-13
|
|
steps:
|
|
- name: git checkout
|
|
uses: actions/checkout@v4
|
|
- name: brew
|
|
uses: ./.github/actions/brew
|
|
- name: ccache
|
|
uses: hendrikmuhs/ccache-action@v1.2
|
|
with:
|
|
key: "${{github.job}}-${{hashFiles('main/php_version.h')}}"
|
|
append-timestamp: false
|
|
- name: ./configure
|
|
uses: ./.github/actions/configure-macos
|
|
with:
|
|
configurationParameters: --enable-debug --disable-zts
|
|
- name: make
|
|
run: |-
|
|
export PATH="/usr/local/opt/bison/bin:$PATH"
|
|
make -j$(sysctl -n hw.logicalcpu) >/dev/null
|
|
- name: make install
|
|
run: sudo make install
|
|
- name: Test Tracing JIT
|
|
uses: ./.github/actions/test-macos
|
|
with:
|
|
testArtifacts: ${{ matrix.debug && 'DEBUG' || 'RELEASE' }}_${{ matrix.zts && 'ZTS' || 'NTS' }} Tracing JIT
|
|
jitType: tracing
|
|
runTestsParameters: >-
|
|
-d zend_extension=opcache.so
|
|
-d opcache.enable_cli=1
|
|
- name: Verify generated files are up to date
|
|
uses: ./.github/actions/verify-generated-files
|
|
WINDOWS:
|
|
name: WINDOWS_X64_ZTS
|
|
runs-on: 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_downloads_server_migration_v1
|
|
PHP_BUILD_CRT: vs16
|
|
PLATFORM: x64
|
|
THREAD_SAFE: "1"
|
|
INTRINSICS: AVX2
|
|
PARALLEL: -j2
|
|
OPCACHE: "1"
|
|
steps:
|
|
- name: git config
|
|
run: git config --global core.autocrlf false && git config --global core.eol lf
|
|
- name: git checkout
|
|
uses: actions/checkout@v4
|
|
- name: Setup
|
|
uses: ./.github/actions/setup-windows
|
|
- name: Build
|
|
run: .github/scripts/windows/build.bat
|
|
- name: Test
|
|
run: .github/scripts/windows/test.bat
|
|
BENCHMARKING:
|
|
name: BENCHMARKING
|
|
if: github.repository_owner == 'php' || github.event_name == 'pull_request'
|
|
runs-on: ubuntu-22.04
|
|
steps:
|
|
- name: git checkout
|
|
uses: actions/checkout@v4
|
|
with:
|
|
fetch-depth: 0
|
|
- 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: hendrikmuhs/ccache-action@v1.2
|
|
with:
|
|
key: "${{github.job}}-${{hashFiles('main/php_version.h')}}"
|
|
append-timestamp: false
|
|
- name: ./configure
|
|
run: |
|
|
set -x
|
|
./buildconf --force
|
|
./configure \
|
|
--disable-debug \
|
|
--enable-mbstring \
|
|
--enable-opcache \
|
|
--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 zend_extension=opcache.so >> /etc/php.d/opcache.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@v4
|
|
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@v3
|
|
with:
|
|
name: profiles
|
|
path: ${{ github.workspace }}/benchmark/profiles
|
|
retention-days: 30
|