Merge branch 'PHP-8.3' into PHP-8.4 #3375
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: CI | |
| on: | |
| push: | |
| branches: [PHP-8.4] | |
| paths-ignore: | |
| - 'docs/**' | |
| - '.editorconfig' | |
| - '.gitignore' | |
| - 'CHANGELOG.md' | |
| - 'README.md' | |
| pull_request: | |
| branches: [PHP-8.4] | |
| paths-ignore: | |
| - 'docs/**' | |
| - '.editorconfig' | |
| - '.gitignore' | |
| - 'CHANGELOG.md' | |
| - 'README.md' | |
| jobs: | |
| linux: | |
| name: Linux ${{ matrix.os.label }} ${{ matrix.compiler.name }} ${{ matrix.generator.name }} | |
| runs-on: ${{ matrix.os.label }} | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| os: | |
| - { label: ubuntu-latest } | |
| compiler: | |
| - { name: GNU, CC: gcc, CXX: g++ } | |
| - { name: Clang, CC: clang, CXX: clang++ } | |
| generator: | |
| - { | |
| name: "Unix Makefiles", | |
| build_options: "", | |
| test_options: "", | |
| install_options: "" | |
| } | |
| - { | |
| name: "Ninja Multi-Config", | |
| build_options: "--config Release", | |
| test_options: "--build-config Release", | |
| install_options: "--config Release" | |
| } | |
| php: | |
| - 8.4-dev | |
| env: | |
| CC: ${{ matrix.compiler.CC }} | |
| CXX: ${{ matrix.compiler.CXX }} | |
| CMAKE_BUILD_TYPE: Release | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v6 | |
| with: | |
| fetch-depth: 2 | |
| - uses: ./.github/actions/setup | |
| - name: Install CMake and Ninja | |
| uses: lukka/get-cmake@latest | |
| id: cmake-and-ninja | |
| - name: Configure and build PHP | |
| run: | | |
| cmake --preset all-enabled \ | |
| -DCMAKE_INSTALL_PREFIX=/usr \ | |
| -G "${{ matrix.generator.name }}" | |
| cmake --build --preset all-enabled ${{ matrix.generator.build_options }} | |
| - name: Setup SNMP agents | |
| run: | | |
| cd php-build/all-enabled/php-src | |
| sudo cp ext/snmp/tests/{snmpd.conf,bigtest} /etc/snmp | |
| sudo systemctl restart snmpd | |
| - name: Run tests | |
| if: ${{ always() }} | |
| run: ctest --preset all-enabled ${{ matrix.generator.test_options }} | |
| - name: Install PHP | |
| if: ${{ always() }} | |
| run: | | |
| sudo "${{ steps.cmake-and-ninja.outputs.cmake-path }}/cmake" \ | |
| --install php-build/all-enabled/php \ | |
| -j $(nproc) \ | |
| ${{ matrix.generator.install_options }} | |
| - name: Setup self-contained extension | |
| if: ${{ always() }} | |
| run: | | |
| php php-build/all-enabled/php-src/ext/ext_skel.php --ext phantom | |
| cd php-build/all-enabled/php-src/ext/phantom | |
| cmake \ | |
| -B cmake-build \ | |
| -G "${{ matrix.generator.name }}" | |
| cmake --build cmake-build -j ${{ matrix.generator.build_options }} | |
| ctest --test-dir cmake-build -j --verbose ${{ matrix.generator.test_options }} | |
| sudo "${{ steps.cmake-and-ninja.outputs.cmake-path }}/cmake" \ | |
| --install cmake-build \ | |
| -j $(nproc) \ | |
| ${{ matrix.generator.install_options }} | |
| php -d extension=phantom -m | grep phantom | |
| windows: | |
| runs-on: windows-latest | |
| name: Windows | |
| steps: | |
| - name: Install CMake and Ninja | |
| uses: lukka/get-cmake@latest | |
| id: cmake-and-ninja | |
| - name: Checkout | |
| uses: actions/checkout@v6 | |
| with: | |
| fetch-depth: 2 | |
| - name: Build and install | |
| run: | | |
| ${{ steps.cmake-and-ninja.outputs.cmake-path }}/cmake --preset windows | |
| ${{ steps.cmake-and-ninja.outputs.cmake-path }}/cmake --build --preset windows | |
| autotools: | |
| runs-on: ubuntu-latest | |
| name: Autotools build and PHP extension CMake build | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v6 | |
| with: | |
| fetch-depth: 2 | |
| - name: Install base dependencies | |
| run: | | |
| sudo apt-get update | |
| sudo apt-get -y install \ | |
| build-essential \ | |
| gcc \ | |
| g++ \ | |
| re2c \ | |
| bison \ | |
| libxml2-dev \ | |
| libsqlite3-dev | |
| - name: Install CMake and Ninja | |
| uses: lukka/get-cmake@latest | |
| id: cmake-and-ninja | |
| - name: Build and install | |
| run: | | |
| cmake --preset all-disabled -DCMAKE_INSTALL_PREFIX=/usr | |
| cd php-build/all-disabled/php-src | |
| mkdir autotools-build | |
| cd autotools-build | |
| ../buildconf | |
| ../configure --disable-all --enable-tokenizer | |
| make -j $(nproc) | |
| sudo make install | |
| - name: Setup self-contained extension | |
| if: ${{ always() }} | |
| run: | | |
| php php-build/all-disabled/php-src/ext/ext_skel.php --ext phantom | |
| cd php-build/all-disabled/php-src/ext/phantom | |
| cmake -B cmake-build | |
| cmake --build cmake-build -j | |
| ctest --test-dir cmake-build -j --verbose | |
| sudo "${{ steps.cmake-and-ninja.outputs.cmake-path }}/cmake" \ | |
| --install cmake-build \ | |
| -j $(nproc) | |
| php -d extension=phantom -m | grep phantom | |
| self-contained-extensions: | |
| runs-on: ubuntu-latest | |
| name: Build php-src extensions as self-contained | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v6 | |
| with: | |
| fetch-depth: 2 | |
| - uses: ./.github/actions/setup | |
| - name: Install CMake and Ninja | |
| uses: lukka/get-cmake@latest | |
| id: cmake-and-ninja | |
| - name: Build and install PHP | |
| run: | | |
| cmake --preset all-disabled \ | |
| -DCMAKE_INSTALL_PREFIX=/usr \ | |
| -DPHP_EXT_LIBXML=ON | |
| cmake --build --preset all-disabled | |
| sudo "${{ steps.cmake-and-ninja.outputs.cmake-path }}/cmake" \ | |
| --install php-build/all-disabled/php \ | |
| -j $(nproc) | |
| - name: Build extensions | |
| run: | | |
| cd php-build/all-disabled/php-src/ext | |
| extensions="tokenizer mysqlnd pdo" | |
| for extension in $extensions; do | |
| cd "$extension" | |
| cmake -B cmake-build | |
| cmake --build cmake-build -j | |
| ctest --test-dir cmake-build -j --verbose | |
| sudo "${{ steps.cmake-and-ninja.outputs.cmake-path }}/cmake" \ | |
| --install cmake-build \ | |
| -j $(nproc) | |
| echo "extension=${extension}" | sudo tee -a /etc/php/php.ini | |
| cd .. | |
| done | |
| skips="\ | |
| com_dotnet \ | |
| date \ | |
| hash \ | |
| json \ | |
| libxml \ | |
| mysqlnd \ | |
| pcre \ | |
| pdo \ | |
| random \ | |
| reflection \ | |
| skeleton \ | |
| spl \ | |
| standard \ | |
| tokenizer \ | |
| " | |
| for extension in *; do | |
| for skip in $skips; do | |
| if [ "$extension" = "$skip" ]; then | |
| continue 2 | |
| fi | |
| done | |
| [ -d "$extension" ] || continue | |
| cd "$extension" | |
| cmake -B cmake-build | |
| cmake --build cmake-build -j | |
| sudo "${{ steps.cmake-and-ninja.outputs.cmake-path }}/cmake" \ | |
| --install cmake-build \ | |
| -j $(nproc) | |
| if [ "$extension" = "opcache" ]; then | |
| echo "zend_extension=${extension}" | sudo tee -a /etc/php/php.ini | |
| else | |
| echo "extension=${extension}" | sudo tee -a /etc/php/php.ini | |
| fi | |
| cd .. | |
| done | |
| configure-command: | |
| runs-on: ubuntu-latest | |
| name: PHP without configure command in phpinfo | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v6 | |
| with: | |
| fetch-depth: 2 | |
| - uses: ./.github/actions/setup | |
| - name: Install CMake and Ninja | |
| uses: lukka/get-cmake@latest | |
| id: cmake-and-ninja | |
| - name: Build and test PHP | |
| run: | | |
| cmake --preset all-disabled -DPHP_CONFIGURE_COMMAND=OFF | |
| cmake --build --preset all-disabled | |
| ctest --preset all-disabled -R PhpSapiCliConfigureCommand |