Merge pull request #378 from asgrim/catch-bundled-php-ext-refusal #697
Workflow file for this run
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: "Continuous Integration" | |
| on: | |
| pull_request: | |
| push: | |
| permissions: | |
| contents: read | |
| jobs: | |
| unit-tests: | |
| runs-on: ${{ matrix.operating-system }} | |
| strategy: | |
| matrix: | |
| operating-system: | |
| - ubuntu-latest | |
| - windows-latest | |
| php-versions: | |
| - '8.1' | |
| - '8.2' | |
| - '8.3' | |
| - '8.4' | |
| - '8.5' | |
| steps: | |
| - name: Setup PHP | |
| uses: shivammathur/setup-php@v2 | |
| with: | |
| php-version: ${{ matrix.php-versions }} | |
| extensions: intl, sodium, zip | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| - uses: actions/checkout@v5 | |
| - uses: ramsey/composer-install@v3 | |
| - name: GH token (non-Windows) | |
| if: matrix.operating-system != 'windows-latest' | |
| run: sudo composer config --global --auth github-oauth.github.com ${{ secrets.GITHUB_TOKEN }} | |
| - name: GH token (Windows) | |
| if: matrix.operating-system == 'windows-latest' | |
| run: composer config --global --auth github-oauth.github.com ${{ secrets.GITHUB_TOKEN }} | |
| - name: Run PHPUnit on Windows | |
| if: matrix.operating-system == 'windows-latest' | |
| run: vendor/bin/phpunit | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Run PHPUnit on non-Windows | |
| if: matrix.operating-system != 'windows-latest' | |
| run: sudo vendor/bin/phpunit | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| bundled-php-extension-tests: | |
| runs-on: ${{ matrix.operating-system }} | |
| strategy: | |
| matrix: | |
| operating-system: | |
| - ubuntu-latest | |
| php-versions: | |
| - '8.1.33' | |
| - '8.2.29' | |
| - '8.3.25' | |
| - '8.4.12' | |
| - '8.5.0beta2' | |
| steps: | |
| - name: "Purge built-in PHP version" | |
| run: | | |
| echo "libmemcached11 php* hhvm libhashkit2" | xargs -n 1 sudo apt-get purge --assume-yes || true | |
| sudo apt-add-repository --remove ppa:ondrej/php -y | |
| - name: Install platform dependencies | |
| run: | | |
| sudo apt-get update | |
| sudo apt-get install -y --no-install-recommends \ | |
| g++ gcc make autoconf libtool bison re2c pkg-config unzip \ | |
| libcurl4-openssl-dev \ | |
| liblmdb-dev \ | |
| libdb-dev \ | |
| libqdbm-dev \ | |
| libenchant-2-dev \ | |
| libexif-dev \ | |
| libgd-dev \ | |
| libpng-dev \ | |
| libtiff-dev \ | |
| libfreetype-dev \ | |
| libfreetype6 \ | |
| libfontconfig1-dev \ | |
| libgmp-dev \ | |
| libssl-dev \ | |
| libsodium-dev \ | |
| libxml2-dev \ | |
| libonig-dev \ | |
| libldap-dev \ | |
| libedit-dev \ | |
| libsnmp-dev \ | |
| libtidy-dev \ | |
| libxslt1-dev \ | |
| libsasl2-dev \ | |
| libpq-dev \ | |
| libsqlite3-dev \ | |
| libzip-dev | |
| - name: "Set php-src download URL" | |
| run: echo "php_src_download_url=https://www.php.net/distributions/php-${{ matrix.php-versions }}.tar.gz" >> $GITHUB_ENV | |
| - name: "Set php-src download URL (8.5 pre-release)" | |
| if: ${{ startsWith(matrix.php-versions, '8.5.') }} | |
| run: echo "php_src_download_url=https://downloads.php.net/~daniels/php-${{ matrix.php-versions }}.tar.gz" >> $GITHUB_ENV | |
| - name: "Install PHP ${{ matrix.php-versions }}" | |
| run: | | |
| mkdir -p /tmp/php | |
| mkdir -p /tmp/php.ini.d | |
| cd /tmp/php | |
| echo "Downloading release from ${{ env.php_src_download_url }} ..." | |
| wget -O php.tgz ${{ env.php_src_download_url }} | |
| tar zxf php.tgz | |
| rm php.tgz | |
| ls -l | |
| cd * | |
| ls -l | |
| ./buildconf --force | |
| ./configure --disable-dom --disable-xml --disable-xmlreader --disable-xmlwriter --disable-json --with-openssl --with-config-file-scan-dir=/tmp/php.ini.d | |
| make -j$(nproc) | |
| sudo make install | |
| cd $GITHUB_WORKSPACE | |
| - uses: actions/checkout@v5 | |
| - name: Composer Install | |
| run: composer install --ignore-platform-reqs | |
| - name: Run bundled PHP install test | |
| run: sudo php test/install-bundled-php-exts.php php-config | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| behaviour-tests: | |
| runs-on: ${{ matrix.operating-system }} | |
| strategy: | |
| matrix: | |
| operating-system: | |
| - ubuntu-latest | |
| - windows-latest | |
| php-versions: | |
| - '8.1' | |
| - '8.2' | |
| - '8.3' | |
| - '8.4' | |
| - '8.5' | |
| steps: | |
| - name: Setup PHP | |
| uses: shivammathur/setup-php@v2 | |
| with: | |
| php-version: ${{ matrix.php-versions }} | |
| extensions: intl, sodium, zip | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| - uses: actions/checkout@v5 | |
| - uses: ramsey/composer-install@v3 | |
| - name: Run Behat on Windows | |
| if: matrix.operating-system == 'windows-latest' | |
| run: vendor/bin/behat --tags="~@non-windows" | |
| - name: Run Behat on non-Windows | |
| if: matrix.operating-system != 'windows-latest' | |
| run: sudo vendor/bin/behat | |
| coding-standards: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Setup PHP | |
| uses: shivammathur/setup-php@v2 | |
| with: | |
| php-version: 8.1 | |
| extensions: intl, sodium, zip | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| - uses: actions/checkout@v5 | |
| - uses: ramsey/composer-install@v3 | |
| - name: Run PHPCS | |
| run: vendor/bin/phpcs | |
| static-analysis: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Setup PHP | |
| uses: shivammathur/setup-php@v2 | |
| with: | |
| php-version: 8.1 | |
| extensions: intl, sodium, zip | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| - uses: actions/checkout@v5 | |
| - uses: ramsey/composer-install@v3 | |
| - name: Validate the composer configuration | |
| run: composer validate --strict | |
| - name: Run phpstan | |
| run: vendor/bin/phpstan | |
| build-phar: | |
| needs: | |
| - unit-tests | |
| - coding-standards | |
| - static-analysis | |
| # See build-phar.yml for a list of the permissions and why they are needed | |
| permissions: | |
| contents: read | |
| id-token: write | |
| attestations: write | |
| uses: ./.github/workflows/build-phar.yml |