chore(deps): update dependency rector/rector to v2.6.6 #154
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: build-sidecar-client | |
| on: | |
| push: | |
| branches: | |
| - '[0-9]+.[0-9]+.x' | |
| paths: | |
| - 'src/Sidecar/Client/**' | |
| - 'tests/Sidecar/Client/**' | |
| - 'rector-sidecar-client.php' | |
| - 'tools/rector/**' | |
| - 'tools/build-sidecar-client.sh' | |
| - '.github/workflows/build-sidecar-client.yml' | |
| - 'composer.json' | |
| - 'composer.lock' | |
| pull_request: | |
| branches: | |
| - '*' | |
| paths: | |
| - 'src/Sidecar/Client/**' | |
| - 'tests/Sidecar/Client/**' | |
| - 'rector-sidecar-client.php' | |
| - 'tools/rector/**' | |
| - 'tools/build-sidecar-client.sh' | |
| - '.github/workflows/build-sidecar-client.yml' | |
| - 'composer.json' | |
| - 'composer.lock' | |
| workflow_dispatch: | |
| jobs: | |
| build: | |
| name: Rector downgrade | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - name: Setup PHP | |
| uses: shivammathur/setup-php@v2 | |
| with: | |
| php-version: 8.5 | |
| coverage: none | |
| - name: Get Composer cache directory | |
| id: composer-cache | |
| run: echo "dir=$(composer config cache-files-dir)" >> "$GITHUB_OUTPUT" | |
| - name: Cache Composer dependencies | |
| uses: actions/cache@v5 | |
| with: | |
| path: ${{ steps.composer-cache.outputs.dir }} | |
| key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.json') }} | |
| restore-keys: ${{ runner.os }}-composer- | |
| - name: Install monorepo dependencies (Rector + custom rules) | |
| run: composer install --prefer-dist --no-progress --no-suggest | |
| - name: Build downgraded artifact | |
| run: tools/build-sidecar-client.sh | |
| # Composer 1 was shut down on Packagist (2025-09-01) and Composer 2 | |
| # requires PHP >= 7.2.5, so we cannot run `composer install` on the | |
| # PHP 7.0 verifier. Pre-populate the artifact's vendor/ here on | |
| # PHP 8.5 with the phpunit constraint pinned to ~6.5.0 — the only | |
| # phpunit major that runs on PHP 7.0. --ignore-platform-req=php | |
| # lets the resolver target our PHP 7.0 floor while running on the | |
| # build host's 8.5. (--prefer-lowest alone is not robust here; | |
| # composer 2 on a recent host can still pick a higher PHPUnit | |
| # major within the artifact's "^6.5 || ^7 || ^8 || ^9" range, as | |
| # observed empirically on CI.) | |
| - name: Pre-install verification dependencies into artifact | |
| working-directory: build/sidecar-client | |
| run: | | |
| composer update --prefer-lowest --no-interaction --no-progress \ | |
| --ignore-platform-req=php \ | |
| --with 'phpunit/phpunit:~6.5.0' | |
| - name: Upload artifact | |
| uses: actions/upload-artifact@v7 | |
| with: | |
| name: sidecar-client-build | |
| path: build/sidecar-client | |
| retention-days: 7 | |
| if-no-files-found: error | |
| verify-php70: | |
| name: Verify on PHP 7.0 | |
| needs: build | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Download downgraded artifact | |
| uses: actions/download-artifact@v8 | |
| with: | |
| name: sidecar-client-build | |
| path: build/sidecar-client | |
| - name: Setup PHP 7.0 | |
| uses: shivammathur/setup-php@v2 | |
| with: | |
| php-version: '7.0' | |
| # pcntl is needed by SidecarClientTest, which spawns child | |
| # processes via pcntl_fork() to drive both ends of a Unix | |
| # socket round-trip. PHP 7.0's CLI image doesn't enable it | |
| # by default. | |
| extensions: pcntl | |
| coverage: none | |
| - name: Lint downgraded files | |
| working-directory: build/sidecar-client | |
| run: find . -name '*.php' -not -path './vendor/*' -print0 | xargs -0 -n 1 php -l | |
| - name: Run downgraded test suite (phpunit 6.5 on PHP 7.0) | |
| working-directory: build/sidecar-client | |
| # Invoke phpunit through `php` rather than executing it directly: | |
| # actions/upload-artifact and actions/download-artifact strip the | |
| # executable bit, so `vendor/bin/phpunit` returns exit 126 | |
| # (permission denied) when called as a binary. | |
| run: php vendor/bin/phpunit tests/ | |
| verify-modern-php: | |
| name: Verify on PHP ${{ matrix.php }} (no deprecations) | |
| needs: build | |
| runs-on: ubuntu-latest | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| php: ['8.4', '8.5'] | |
| steps: | |
| - name: Download downgraded artifact | |
| uses: actions/download-artifact@v8 | |
| with: | |
| name: sidecar-client-build | |
| path: build/sidecar-client | |
| - name: Setup PHP ${{ matrix.php }} | |
| uses: shivammathur/setup-php@v2 | |
| with: | |
| php-version: ${{ matrix.php }} | |
| coverage: none | |
| - name: Lint downgraded files | |
| working-directory: build/sidecar-client | |
| run: find . -name '*.php' -not -path './vendor/*' -print0 | xargs -0 -n 1 php -l | |
| # End users on modern PHP `composer require` the downgraded artifact, | |
| # so the downgraded source must autoload AND exercise its constructors | |
| # without emitting Deprecated/Warning/Notice. This catches regressions | |
| # like the PHP 8.4 implicit-nullable-parameter deprecation | |
| # (`int $x = null` is deprecated; use `?int $x = null` or no type). | |
| - name: Smoke load + instantiate (no PHP-level diagnostics expected) | |
| working-directory: build/sidecar-client | |
| run: | | |
| set -o pipefail | |
| out=$(php -d error_reporting=E_ALL -d display_errors=1 -r ' | |
| require "vendor/autoload.php"; | |
| new Reli\Sidecar\Client\SidecarClient("/tmp/reli-smoke.sock", 5); | |
| new Reli\Sidecar\Client\SidecarClientResponse( | |
| "ok", 1, "/tmp/x", 100, ["frame"], null, null, null | |
| ); | |
| Reli\Sidecar\Client\SidecarClientResponse::fromJson(json_encode(["status"=>"ok"])); | |
| echo "OK\n"; | |
| ' 2>&1) | |
| printf '%s\n' "$out" | |
| if printf '%s\n' "$out" | grep -qE '^(PHP )?(Deprecated|Warning|Notice|Strict standards|Fatal error):'; then | |
| echo "::error::PHP emitted diagnostics on modern PHP — downgrade pipeline regression" | |
| exit 1 | |
| fi | |
| printf '%s\n' "$out" | grep -q '^OK$' || { echo "::error::smoke did not reach OK marker"; exit 1; } |