From 50adae4cf239fdbb1c8845ebeeacba7dec521ad8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=B4me=20Gamez?= Date: Fri, 6 Feb 2026 00:30:28 +0100 Subject: [PATCH 01/18] Isolate grpc tests --- .github/workflows/emulator-tests.yml | 22 +---- .github/workflows/grpc-tests.yml | 104 ++++++++++++++++++++ .github/workflows/integration-tests.yml | 22 +---- .github/workflows/static-analysis.yml | 22 +---- .github/workflows/tests.yml | 22 +---- tests/Integration/Factory/FirestoreTest.php | 14 +-- 6 files changed, 116 insertions(+), 90 deletions(-) create mode 100644 .github/workflows/grpc-tests.yml diff --git a/.github/workflows/emulator-tests.yml b/.github/workflows/emulator-tests.yml index 50644bdf..805ce1af 100644 --- a/.github/workflows/emulator-tests.yml +++ b/.github/workflows/emulator-tests.yml @@ -33,8 +33,6 @@ jobs: env: php-version: '8.4' - extensions: grpc - key: cache-v1 steps: - name: Checkout code @@ -42,26 +40,10 @@ jobs: with: ref: ${{ (github.event_name == 'pull_request_target' && github.event.pull_request.head.sha) || github.sha }} - - name: Setup cache environment - id: extcache - uses: shivammathur/cache-extensions@v1 - with: - php-version: ${{ env.php-version }} - extensions: ${{ env.extensions }} - key: ${{ env.key }} - - - name: Cache extensions - uses: actions/cache@v5.0.2 - with: - path: ${{ steps.extcache.outputs.dir }} - key: ${{ steps.extcache.outputs.key }} - restore-keys: ${{ steps.extcache.outputs.key }} - - name: Setup PHP uses: shivammathur/setup-php@v2 with: php-version: ${{ env.php-version }} - extensions: ${{ env.extensions }} tools: composer, pecl coverage: xdebug @@ -69,6 +51,8 @@ jobs: run: echo "::add-matcher::${{ runner.tool_cache }}/php.json" - uses: "ramsey/composer-install@v3" + with: + composer-options: "--ignore-platform-req=ext-grpc" - name: Setup Problem Matchers for PHPUnit run: echo "::add-matcher::${{ runner.tool_cache }}/phpunit.json" @@ -97,7 +81,7 @@ jobs: FIREBASE_DATABASE_EMULATOR_HOST: localhost:9100 FIREBASE_AUTH_EMULATOR_HOST: localhost:9099 XDEBUG_MODE: coverage - run: firebase emulators:exec --only auth,database --project beste-firebase 'XDEBUG_MODE=coverage vendor/bin/phpunit --group=emulator --coverage-clover=coverage.xml --log-junit=test-report.xml' + run: firebase emulators:exec --only auth,database --project beste-firebase 'XDEBUG_MODE=coverage vendor/bin/phpunit --group=emulator --exclude-group grpc --coverage-clover=coverage.xml --log-junit=test-report.xml' - name: Upload test results to Codecov if: ${{ !cancelled() }} diff --git a/.github/workflows/grpc-tests.yml b/.github/workflows/grpc-tests.yml new file mode 100644 index 00000000..7d663f5d --- /dev/null +++ b/.github/workflows/grpc-tests.yml @@ -0,0 +1,104 @@ +name: gRPC Tests + +on: + pull_request_target: + types: [opened, synchronize, reopened] + paths: + - 'src/**' + - 'tests/**' + - '.github/workflows/grpc-tests.yml' + - 'composer.json' + - 'phpstan.neon.dist' + push: + branches: ['8.x'] + paths: + - 'src/**' + - 'tests/**' + - '.github/workflows/grpc-tests.yml' + - 'composer.json' + - 'phpstan.neon.dist' + workflow_dispatch: + +permissions: + contents: read + +concurrency: + group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} + cancel-in-progress: true + +jobs: + grpc-tests: + name: gRPC Tests (PHP 8.4) + runs-on: ubuntu-latest + continue-on-error: true + + env: + php-version: '8.4' + extensions: grpc + key: cache-v1 + + steps: + - name: Checkout code + uses: actions/checkout@v6 + with: + ref: ${{ (github.event_name == 'pull_request_target' && github.event.pull_request.head.sha) || github.sha }} + + - name: Setup cache environment + id: extcache + uses: shivammathur/cache-extensions@v1 + with: + php-version: ${{ env.php-version }} + extensions: ${{ env.extensions }} + key: ${{ env.key }} + + - name: Cache extensions + uses: actions/cache@v5.0.2 + with: + path: ${{ steps.extcache.outputs.dir }} + key: ${{ steps.extcache.outputs.key }} + restore-keys: ${{ steps.extcache.outputs.key }} + + - name: Setup PHP + uses: shivammathur/setup-php@v2 + with: + php-version: ${{ env.php-version }} + extensions: ${{ env.extensions }} + ini-values: grpc.grpc_verbosity=error, grpc.grpc_trace= + tools: composer, pecl + coverage: xdebug + + - name: Setup problem matchers for PHP + run: echo "::add-matcher::${{ runner.tool_cache }}/php.json" + + - uses: "ramsey/composer-install@v3" + + - name: Setup Problem Matchers for PHPUnit + run: echo "::add-matcher::${{ runner.tool_cache }}/phpunit.json" + + - name: Run gRPC Tests + env: + GOOGLE_APPLICATION_CREDENTIALS: ${{secrets.GOOGLE_APPLICATION_CREDENTIALS}} + TEST_FIREBASE_APP_ID: ${{secrets.TEST_FIREBASE_APP_ID}} + TEST_FIREBASE_RTDB_URI: ${{secrets.TEST_FIREBASE_RTDB_URI}} + TEST_FIREBASE_TENANT_ID: ${{secrets.TEST_FIREBASE_TENANT_ID}} + TEST_REGISTRATION_TOKENS: ${{secrets.TEST_REGISTRATION_TOKENS}} + XDEBUG_MODE: coverage + run: vendor/bin/phpunit --group grpc --coverage-clover=coverage.xml --log-junit=test-report.xml --testdox + + - name: Upload test results to Codecov + if: ${{ !cancelled() }} + uses: codecov/codecov-action@v5 + with: + token: ${{ secrets.CODECOV_TOKEN }} + flags: grpc + report_type: test_results + fail_ci_if_error: false + + - name: Upload coverage to Codecov + if: ${{ !cancelled() }} + uses: codecov/codecov-action@v5 + with: + token: ${{ secrets.CODECOV_TOKEN }} + files: ./coverage.xml + flags: grpc + fail_ci_if_error: false diff --git a/.github/workflows/integration-tests.yml b/.github/workflows/integration-tests.yml index 74866be2..c7d64686 100644 --- a/.github/workflows/integration-tests.yml +++ b/.github/workflows/integration-tests.yml @@ -33,8 +33,6 @@ jobs: env: php-version: '8.4' - extensions: grpc - key: cache-v1 steps: - name: Checkout code @@ -42,26 +40,10 @@ jobs: with: ref: ${{ (github.event_name == 'pull_request_target' && github.event.pull_request.head.sha) || github.sha }} - - name: Setup cache environment - id: extcache - uses: shivammathur/cache-extensions@v1 - with: - php-version: ${{ env.php-version }} - extensions: ${{ env.extensions }} - key: ${{ env.key }} - - - name: Cache extensions - uses: actions/cache@v5.0.2 - with: - path: ${{ steps.extcache.outputs.dir }} - key: ${{ steps.extcache.outputs.key }} - restore-keys: ${{ steps.extcache.outputs.key }} - - name: Setup PHP uses: shivammathur/setup-php@v2 with: php-version: ${{ env.php-version }} - extensions: ${{ env.extensions }} tools: composer, pecl coverage: xdebug @@ -69,6 +51,8 @@ jobs: run: echo "::add-matcher::${{ runner.tool_cache }}/php.json" - uses: "ramsey/composer-install@v3" + with: + composer-options: "--ignore-platform-req=ext-grpc" - name: Setup Problem Matchers for PHPUnit run: echo "::add-matcher::${{ runner.tool_cache }}/phpunit.json" @@ -81,7 +65,7 @@ jobs: TEST_FIREBASE_TENANT_ID: ${{secrets.TEST_FIREBASE_TENANT_ID}} TEST_REGISTRATION_TOKENS: ${{secrets.TEST_REGISTRATION_TOKENS}} XDEBUG_MODE: coverage - run: vendor/bin/phpunit --testsuite=integration --coverage-clover=coverage.xml --log-junit=test-report.xml --testdox + run: vendor/bin/phpunit --testsuite=integration --exclude-group grpc --coverage-clover=coverage.xml --log-junit=test-report.xml --testdox - name: Upload test results to Codecov if: ${{ !cancelled() }} diff --git a/.github/workflows/static-analysis.yml b/.github/workflows/static-analysis.yml index c90a5ad6..d1df61b9 100644 --- a/.github/workflows/static-analysis.yml +++ b/.github/workflows/static-analysis.yml @@ -38,40 +38,20 @@ jobs: - "8.4" - "8.5" - env: - extensions: grpc - key: cache-v1 - steps: - name: Checkout code uses: actions/checkout@v6 - - name: Setup cache environment - id: extcache - uses: shivammathur/cache-extensions@v1 - with: - php-version: ${{ matrix.php }} - extensions: ${{ env.extensions }} - key: ${{ env.key }} - - - name: Cache extensions - uses: actions/cache@v5.0.2 - with: - path: ${{ steps.extcache.outputs.dir }} - key: ${{ steps.extcache.outputs.key }} - restore-keys: ${{ steps.extcache.outputs.key }} - - name: Setup PHP uses: shivammathur/setup-php@v2 with: php-version: ${{ matrix.php }} - extensions: ${{ env.extensions }} tools: composer, pecl coverage: none - uses: "ramsey/composer-install@v3" with: - composer-options: "${{ matrix.composer-options }}" + composer-options: "--ignore-platform-req=ext-grpc ${{ matrix.composer-options }}" - name: Setup problem matchers for PHP run: echo "::add-matcher::${{ runner.tool_cache }}/php.json" diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 0de082b1..dc6b0c12 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -41,40 +41,20 @@ jobs: - "lowest" - "highest" - env: - extensions: grpc - key: cache-v1 - steps: - name: Checkout code uses: actions/checkout@v6 - - name: Setup cache environment - id: extcache - uses: shivammathur/cache-extensions@v1 - with: - php-version: ${{ matrix.php }} - extensions: ${{ env.extensions }} - key: ${{ env.key }} - - - name: Cache extensions - uses: actions/cache@v5.0.2 - with: - path: ${{ steps.extcache.outputs.dir }} - key: ${{ steps.extcache.outputs.key }} - restore-keys: ${{ steps.extcache.outputs.key }} - - name: Setup PHP uses: shivammathur/setup-php@v2 with: php-version: ${{ matrix.php }} - extensions: ${{ env.extensions }} tools: composer, pecl coverage: xdebug - uses: "ramsey/composer-install@v3" with: - composer-options: "${{ matrix.composer-options }}" + composer-options: "--ignore-platform-req=ext-grpc ${{ matrix.composer-options }}" dependency-versions: "${{ matrix.dependencies }}" - name: Setup problem matchers for PHP diff --git a/tests/Integration/Factory/FirestoreTest.php b/tests/Integration/Factory/FirestoreTest.php index 7a5c1296..d18c0971 100644 --- a/tests/Integration/Factory/FirestoreTest.php +++ b/tests/Integration/Factory/FirestoreTest.php @@ -7,10 +7,14 @@ use Exception; use Kreait\Firebase\Tests\IntegrationTestCase; use Kreait\Firebase\Util; +use PHPUnit\Framework\Attributes\Group; +use PHPUnit\Framework\Attributes\RequiresPhpExtension; /** * @internal */ +#[Group('grpc')] +#[RequiresPhpExtension('grpc')] final class FirestoreTest extends IntegrationTestCase { /** @@ -19,11 +23,6 @@ final class FirestoreTest extends IntegrationTestCase */ public function testItUsesTheDefaultDatabaseByDefault(): void { - // @see https://github.com/grpc/grpc/issues/38184 - // @see https://github.com/googleapis/gax-php/issues/584 - // @see https://www.php.net/manual/en/info.configuration.php#ini.zend.reserved-stack-size - $this->markTestSkipped('Skipped because of an infinite recursion with certain PHP/gRPC versions.'); - // @phpstan-ignore deadCode.unreachable $collection = __FUNCTION__; $documentName = __FUNCTION__.self::randomString(); @@ -42,11 +41,6 @@ public function testItUsesTheDefaultDatabaseByDefault(): void public function testItCannotConnectToAnUnknownDatabase(): void { - // @see https://github.com/grpc/grpc/issues/38184 - // @see https://github.com/googleapis/gax-php/issues/584 - // @see https://www.php.net/manual/en/info.configuration.php#ini.zend.reserved-stack-size - $this->markTestSkipped('Skipped because of an infinite recursion with certain PHP/gRPC versions.'); - // @phpstan-ignore deadCode.unreachable $name = self::randomString(); $database = self::$factory->createFirestore($name)->database(); From bdc7b17049d11cd4b1a66cea1700fff3c96687c7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=B4me=20Gamez?= Date: Fri, 6 Feb 2026 00:42:15 +0100 Subject: [PATCH 02/18] Run grpc workflow on pull_request --- .github/workflows/grpc-tests.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/grpc-tests.yml b/.github/workflows/grpc-tests.yml index 7d663f5d..67f19fcc 100644 --- a/.github/workflows/grpc-tests.yml +++ b/.github/workflows/grpc-tests.yml @@ -1,7 +1,8 @@ name: gRPC Tests on: - pull_request_target: + # TEMPORARY: Use pull_request to run gRPC tests in this PR. Revert to pull_request_target before merging. + pull_request: types: [opened, synchronize, reopened] paths: - 'src/**' @@ -31,6 +32,7 @@ jobs: name: gRPC Tests (PHP 8.4) runs-on: ubuntu-latest continue-on-error: true + if: ${{ github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name == github.repository }} env: php-version: '8.4' From 0017157ca11cbf2ec3b1c9a23b5c39d9e91123fa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=B4me=20Gamez?= Date: Fri, 6 Feb 2026 00:43:42 +0100 Subject: [PATCH 03/18] Fix grpc workflow and composer options --- .github/workflows/grpc-tests.yml | 2 +- .github/workflows/static-analysis.yml | 2 +- .github/workflows/tests.yml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/grpc-tests.yml b/.github/workflows/grpc-tests.yml index 67f19fcc..94945aaf 100644 --- a/.github/workflows/grpc-tests.yml +++ b/.github/workflows/grpc-tests.yml @@ -85,7 +85,7 @@ jobs: TEST_FIREBASE_TENANT_ID: ${{secrets.TEST_FIREBASE_TENANT_ID}} TEST_REGISTRATION_TOKENS: ${{secrets.TEST_REGISTRATION_TOKENS}} XDEBUG_MODE: coverage - run: vendor/bin/phpunit --group grpc --coverage-clover=coverage.xml --log-junit=test-report.xml --testdox + run: vendor/bin/phpunit --testsuite=integration --group grpc --coverage-clover=coverage.xml --log-junit=test-report.xml --testdox - name: Upload test results to Codecov if: ${{ !cancelled() }} diff --git a/.github/workflows/static-analysis.yml b/.github/workflows/static-analysis.yml index d1df61b9..62680278 100644 --- a/.github/workflows/static-analysis.yml +++ b/.github/workflows/static-analysis.yml @@ -51,7 +51,7 @@ jobs: - uses: "ramsey/composer-install@v3" with: - composer-options: "--ignore-platform-req=ext-grpc ${{ matrix.composer-options }}" + composer-options: "--ignore-platform-req=ext-grpc" - name: Setup problem matchers for PHP run: echo "::add-matcher::${{ runner.tool_cache }}/php.json" diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index dc6b0c12..25e1b464 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -54,7 +54,7 @@ jobs: - uses: "ramsey/composer-install@v3" with: - composer-options: "--ignore-platform-req=ext-grpc ${{ matrix.composer-options }}" + composer-options: "--ignore-platform-req=ext-grpc" dependency-versions: "${{ matrix.dependencies }}" - name: Setup problem matchers for PHP From 93e760db12b1643535e80721b051f7591fb80353 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=B4me=20Gamez?= Date: Fri, 6 Feb 2026 00:58:19 +0100 Subject: [PATCH 04/18] Run gRPC workflow on PHP 8.3 --- .github/workflows/grpc-tests.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/grpc-tests.yml b/.github/workflows/grpc-tests.yml index 94945aaf..a496a9e7 100644 --- a/.github/workflows/grpc-tests.yml +++ b/.github/workflows/grpc-tests.yml @@ -29,13 +29,13 @@ concurrency: jobs: grpc-tests: - name: gRPC Tests (PHP 8.4) + name: gRPC Tests (PHP 8.3) runs-on: ubuntu-latest continue-on-error: true if: ${{ github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name == github.repository }} env: - php-version: '8.4' + php-version: '8.3' extensions: grpc key: cache-v1 From d22ed5c568e93d241cbcd87ae80fca513a7fdef3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=B4me=20Gamez?= Date: Fri, 6 Feb 2026 01:02:39 +0100 Subject: [PATCH 05/18] Run workflows on PHP 8.5 --- .github/workflows/emulator-tests.yml | 2 +- .github/workflows/grpc-tests.yml | 4 ++-- .github/workflows/integration-tests.yml | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/emulator-tests.yml b/.github/workflows/emulator-tests.yml index 805ce1af..a604ea99 100644 --- a/.github/workflows/emulator-tests.yml +++ b/.github/workflows/emulator-tests.yml @@ -32,7 +32,7 @@ jobs: runs-on: ubuntu-latest env: - php-version: '8.4' + php-version: '8.5' steps: - name: Checkout code diff --git a/.github/workflows/grpc-tests.yml b/.github/workflows/grpc-tests.yml index a496a9e7..80cfefd2 100644 --- a/.github/workflows/grpc-tests.yml +++ b/.github/workflows/grpc-tests.yml @@ -29,13 +29,13 @@ concurrency: jobs: grpc-tests: - name: gRPC Tests (PHP 8.3) + name: gRPC Tests (PHP 8.5) runs-on: ubuntu-latest continue-on-error: true if: ${{ github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name == github.repository }} env: - php-version: '8.3' + php-version: '8.5' extensions: grpc key: cache-v1 diff --git a/.github/workflows/integration-tests.yml b/.github/workflows/integration-tests.yml index c7d64686..efada7d8 100644 --- a/.github/workflows/integration-tests.yml +++ b/.github/workflows/integration-tests.yml @@ -32,7 +32,7 @@ jobs: runs-on: ubuntu-latest env: - php-version: '8.4' + php-version: '8.5' steps: - name: Checkout code From a81f660e7ba9917c8e0f68dfd60b9663c26c9550 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=B4me=20Gamez?= Date: Fri, 6 Feb 2026 01:10:45 +0100 Subject: [PATCH 06/18] Explain gRPC workflow is non-blocking --- .github/workflows/grpc-tests.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/grpc-tests.yml b/.github/workflows/grpc-tests.yml index 80cfefd2..5c2531ca 100644 --- a/.github/workflows/grpc-tests.yml +++ b/.github/workflows/grpc-tests.yml @@ -31,6 +31,9 @@ jobs: grpc-tests: name: gRPC Tests (PHP 8.5) runs-on: ubuntu-latest + # Non-blocking while the gRPC extension is broken/unstable on PHP 8.5. + # See https://github.com/shivammathur/setup-php/issues/1041. + # Remove this once upstream releases a stable extension and tests pass. continue-on-error: true if: ${{ github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name == github.repository }} From ec42e92f9f6b2ac961df77c0434bd79b8c9de0e4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=B4me=20Gamez?= Date: Fri, 6 Feb 2026 01:11:42 +0100 Subject: [PATCH 07/18] Run integration tests on pull_request --- .github/workflows/integration-tests.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/integration-tests.yml b/.github/workflows/integration-tests.yml index efada7d8..51507bc1 100644 --- a/.github/workflows/integration-tests.yml +++ b/.github/workflows/integration-tests.yml @@ -1,7 +1,8 @@ name: Integration Tests on: - pull_request_target: + # TEMPORARY: Use pull_request to run integration tests in this PR. Revert to pull_request_target before merging. + pull_request: types: [opened, synchronize, reopened] paths: - 'src/**' From b6ed7fcfb26dcf55cb3f25640a1c19be510b3da9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=B4me=20Gamez?= Date: Fri, 6 Feb 2026 01:12:24 +0100 Subject: [PATCH 08/18] Run emulator tests on pull_request --- .github/workflows/emulator-tests.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/emulator-tests.yml b/.github/workflows/emulator-tests.yml index a604ea99..df7c7c12 100644 --- a/.github/workflows/emulator-tests.yml +++ b/.github/workflows/emulator-tests.yml @@ -1,7 +1,8 @@ name: Emulator Tests on: - pull_request_target: + # TEMPORARY: Use pull_request to run emulator tests in this PR. Revert to pull_request_target before merging. + pull_request: types: [ opened, synchronize, reopened ] paths: - 'src/**' From c0309c9abbbc78069e5a6f234ac1f8ad0bdbd68c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=B4me=20Gamez?= Date: Fri, 6 Feb 2026 01:16:04 +0100 Subject: [PATCH 09/18] Handle missing gRPC extension in workflow --- .github/workflows/grpc-tests.yml | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/.github/workflows/grpc-tests.yml b/.github/workflows/grpc-tests.yml index 5c2531ca..f0df7ded 100644 --- a/.github/workflows/grpc-tests.yml +++ b/.github/workflows/grpc-tests.yml @@ -75,6 +75,17 @@ jobs: - name: Setup problem matchers for PHP run: echo "::add-matcher::${{ runner.tool_cache }}/php.json" + - name: Detect gRPC extension + id: grpc + run: | + if php -m | grep -qi '^grpc$'; then + echo "grpc_present=true" >> "$GITHUB_OUTPUT" + else + echo "grpc_present=false" >> "$GITHUB_OUTPUT" + echo "COMPOSER_IGNORE_PLATFORM_REQ=ext-grpc" >> "$GITHUB_ENV" + echo "gRPC extension not available; allowing Composer to proceed without ext-grpc." + fi + - uses: "ramsey/composer-install@v3" - name: Setup Problem Matchers for PHPUnit From 83f0548b73b7ac976491e69b51a321af82b7b9eb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=B4me=20Gamez?= Date: Fri, 6 Feb 2026 01:17:17 +0100 Subject: [PATCH 10/18] Update cache key --- .github/workflows/grpc-tests.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/grpc-tests.yml b/.github/workflows/grpc-tests.yml index f0df7ded..ea983798 100644 --- a/.github/workflows/grpc-tests.yml +++ b/.github/workflows/grpc-tests.yml @@ -40,7 +40,7 @@ jobs: env: php-version: '8.5' extensions: grpc - key: cache-v1 + key: cache-grpc steps: - name: Checkout code From a2b955a167f9ac97c5ff3ba05cd26a04521da650 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=B4me=20Gamez?= Date: Fri, 6 Feb 2026 01:19:12 +0100 Subject: [PATCH 11/18] Require grpc extension in grpc workflow --- .github/workflows/grpc-tests.yml | 17 ++--------------- 1 file changed, 2 insertions(+), 15 deletions(-) diff --git a/.github/workflows/grpc-tests.yml b/.github/workflows/grpc-tests.yml index ea983798..be30fd82 100644 --- a/.github/workflows/grpc-tests.yml +++ b/.github/workflows/grpc-tests.yml @@ -38,8 +38,6 @@ jobs: if: ${{ github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name == github.repository }} env: - php-version: '8.5' - extensions: grpc key: cache-grpc steps: @@ -52,8 +50,8 @@ jobs: id: extcache uses: shivammathur/cache-extensions@v1 with: - php-version: ${{ env.php-version }} - extensions: ${{ env.extensions }} + php-version: 8.5 + extensions: grpc key: ${{ env.key }} - name: Cache extensions @@ -75,17 +73,6 @@ jobs: - name: Setup problem matchers for PHP run: echo "::add-matcher::${{ runner.tool_cache }}/php.json" - - name: Detect gRPC extension - id: grpc - run: | - if php -m | grep -qi '^grpc$'; then - echo "grpc_present=true" >> "$GITHUB_OUTPUT" - else - echo "grpc_present=false" >> "$GITHUB_OUTPUT" - echo "COMPOSER_IGNORE_PLATFORM_REQ=ext-grpc" >> "$GITHUB_ENV" - echo "gRPC extension not available; allowing Composer to proceed without ext-grpc." - fi - - uses: "ramsey/composer-install@v3" - name: Setup Problem Matchers for PHPUnit From 6df8ac89c6ef26956015f13cc8963bad028d40e6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=B4me=20Gamez?= Date: Fri, 6 Feb 2026 01:29:09 +0100 Subject: [PATCH 12/18] Add grpc extension check --- .github/workflows/grpc-tests.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/grpc-tests.yml b/.github/workflows/grpc-tests.yml index be30fd82..cbbb8621 100644 --- a/.github/workflows/grpc-tests.yml +++ b/.github/workflows/grpc-tests.yml @@ -73,6 +73,9 @@ jobs: - name: Setup problem matchers for PHP run: echo "::add-matcher::${{ runner.tool_cache }}/php.json" + - name: Verify gRPC extension + run: php -m | grep -i '^grpc$' + - uses: "ramsey/composer-install@v3" - name: Setup Problem Matchers for PHPUnit From 386580faa2840b8b18f17279bcb1e80ceef19ada Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=B4me=20Gamez?= Date: Fri, 6 Feb 2026 01:40:14 +0100 Subject: [PATCH 13/18] Make gRPC workflow non-blocking in checks --- .github/workflows/grpc-tests.yml | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/.github/workflows/grpc-tests.yml b/.github/workflows/grpc-tests.yml index cbbb8621..288eb71a 100644 --- a/.github/workflows/grpc-tests.yml +++ b/.github/workflows/grpc-tests.yml @@ -34,7 +34,6 @@ jobs: # Non-blocking while the gRPC extension is broken/unstable on PHP 8.5. # See https://github.com/shivammathur/setup-php/issues/1041. # Remove this once upstream releases a stable extension and tests pass. - continue-on-error: true if: ${{ github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name == github.repository }} env: @@ -74,7 +73,9 @@ jobs: run: echo "::add-matcher::${{ runner.tool_cache }}/php.json" - name: Verify gRPC extension + id: grpc run: php -m | grep -i '^grpc$' + continue-on-error: true - uses: "ramsey/composer-install@v3" @@ -82,6 +83,7 @@ jobs: run: echo "::add-matcher::${{ runner.tool_cache }}/phpunit.json" - name: Run gRPC Tests + id: grpc-tests env: GOOGLE_APPLICATION_CREDENTIALS: ${{secrets.GOOGLE_APPLICATION_CREDENTIALS}} TEST_FIREBASE_APP_ID: ${{secrets.TEST_FIREBASE_APP_ID}} @@ -90,6 +92,17 @@ jobs: TEST_REGISTRATION_TOKENS: ${{secrets.TEST_REGISTRATION_TOKENS}} XDEBUG_MODE: coverage run: vendor/bin/phpunit --testsuite=integration --group grpc --coverage-clover=coverage.xml --log-junit=test-report.xml --testdox + continue-on-error: true + + - name: Summarize gRPC failures + if: ${{ steps.grpc.outcome == 'failure' || steps.grpc-tests.outcome == 'failure' }} + run: | + { + echo "### gRPC tests are non-blocking" + echo + echo "One or more gRPC steps failed (likely due to missing/broken gRPC on PHP 8.5)." + echo "See https://github.com/shivammathur/setup-php/issues/1041." + } >> "$GITHUB_STEP_SUMMARY" - name: Upload test results to Codecov if: ${{ !cancelled() }} From 0441e13c64969d82b5e20e99737f8069827a3a0d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=B4me=20Gamez?= Date: Fri, 6 Feb 2026 01:41:47 +0100 Subject: [PATCH 14/18] Fix environment variable usage --- .github/workflows/grpc-tests.yml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/.github/workflows/grpc-tests.yml b/.github/workflows/grpc-tests.yml index 288eb71a..6e25c713 100644 --- a/.github/workflows/grpc-tests.yml +++ b/.github/workflows/grpc-tests.yml @@ -38,6 +38,8 @@ jobs: env: key: cache-grpc + php-version: 8.5 + extensions: grpc steps: - name: Checkout code @@ -49,8 +51,8 @@ jobs: id: extcache uses: shivammathur/cache-extensions@v1 with: - php-version: 8.5 - extensions: grpc + php-version: ${{ env.php-version }} + extensions: ${{ env.extensions }} key: ${{ env.key }} - name: Cache extensions From 0dafd57a8f4a9692221a2ecece47529d926b6cb9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=B4me=20Gamez?= Date: Fri, 6 Feb 2026 01:48:38 +0100 Subject: [PATCH 15/18] Skip gRPC steps without extension --- .github/workflows/grpc-tests.yml | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/.github/workflows/grpc-tests.yml b/.github/workflows/grpc-tests.yml index 6e25c713..df7f4c19 100644 --- a/.github/workflows/grpc-tests.yml +++ b/.github/workflows/grpc-tests.yml @@ -80,12 +80,15 @@ jobs: continue-on-error: true - uses: "ramsey/composer-install@v3" + id: composer + if: ${{ steps.grpc.outcome == 'success' }} - name: Setup Problem Matchers for PHPUnit run: echo "::add-matcher::${{ runner.tool_cache }}/phpunit.json" - name: Run gRPC Tests id: grpc-tests + if: ${{ steps.grpc.outcome == 'success' }} env: GOOGLE_APPLICATION_CREDENTIALS: ${{secrets.GOOGLE_APPLICATION_CREDENTIALS}} TEST_FIREBASE_APP_ID: ${{secrets.TEST_FIREBASE_APP_ID}} @@ -102,12 +105,12 @@ jobs: { echo "### gRPC tests are non-blocking" echo - echo "One or more gRPC steps failed (likely due to missing/broken gRPC on PHP 8.5)." + echo "gRPC extension was not available or gRPC tests failed (likely due to missing/broken gRPC on PHP 8.5)." echo "See https://github.com/shivammathur/setup-php/issues/1041." } >> "$GITHUB_STEP_SUMMARY" - name: Upload test results to Codecov - if: ${{ !cancelled() }} + if: ${{ !cancelled() && steps.grpc.outcome == 'success' }} uses: codecov/codecov-action@v5 with: token: ${{ secrets.CODECOV_TOKEN }} @@ -116,7 +119,7 @@ jobs: fail_ci_if_error: false - name: Upload coverage to Codecov - if: ${{ !cancelled() }} + if: ${{ !cancelled() && steps.grpc.outcome == 'success' }} uses: codecov/codecov-action@v5 with: token: ${{ secrets.CODECOV_TOKEN }} From d19b03d376146463fac9024c5738aee34eeefe97 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=B4me=20Gamez?= Date: Fri, 6 Feb 2026 01:50:10 +0100 Subject: [PATCH 16/18] Allow gRPC job failure --- .github/workflows/grpc-tests.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/grpc-tests.yml b/.github/workflows/grpc-tests.yml index df7f4c19..ea0950c3 100644 --- a/.github/workflows/grpc-tests.yml +++ b/.github/workflows/grpc-tests.yml @@ -34,6 +34,7 @@ jobs: # Non-blocking while the gRPC extension is broken/unstable on PHP 8.5. # See https://github.com/shivammathur/setup-php/issues/1041. # Remove this once upstream releases a stable extension and tests pass. + continue-on-error: true if: ${{ github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name == github.repository }} env: @@ -77,7 +78,6 @@ jobs: - name: Verify gRPC extension id: grpc run: php -m | grep -i '^grpc$' - continue-on-error: true - uses: "ramsey/composer-install@v3" id: composer @@ -97,7 +97,6 @@ jobs: TEST_REGISTRATION_TOKENS: ${{secrets.TEST_REGISTRATION_TOKENS}} XDEBUG_MODE: coverage run: vendor/bin/phpunit --testsuite=integration --group grpc --coverage-clover=coverage.xml --log-junit=test-report.xml --testdox - continue-on-error: true - name: Summarize gRPC failures if: ${{ steps.grpc.outcome == 'failure' || steps.grpc-tests.outcome == 'failure' }} From 22edba9ba53657e55de13557863e75ae8312c671 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=B4me=20Gamez?= Date: Fri, 6 Feb 2026 01:51:59 +0100 Subject: [PATCH 17/18] Ensure gRPC summary runs on failure --- .github/workflows/grpc-tests.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/grpc-tests.yml b/.github/workflows/grpc-tests.yml index ea0950c3..bf63f8a3 100644 --- a/.github/workflows/grpc-tests.yml +++ b/.github/workflows/grpc-tests.yml @@ -99,7 +99,7 @@ jobs: run: vendor/bin/phpunit --testsuite=integration --group grpc --coverage-clover=coverage.xml --log-junit=test-report.xml --testdox - name: Summarize gRPC failures - if: ${{ steps.grpc.outcome == 'failure' || steps.grpc-tests.outcome == 'failure' }} + if: ${{ always() && (steps.grpc.outcome == 'failure' || steps.grpc-tests.outcome == 'failure') }} run: | { echo "### gRPC tests are non-blocking" From b3718509a3ec7262603959a4dead757106a3566a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=B4me=20Gamez?= Date: Fri, 6 Feb 2026 01:59:00 +0100 Subject: [PATCH 18/18] Add notice for non-blocking gRPC failures --- .github/workflows/grpc-tests.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/grpc-tests.yml b/.github/workflows/grpc-tests.yml index bf63f8a3..19a439ea 100644 --- a/.github/workflows/grpc-tests.yml +++ b/.github/workflows/grpc-tests.yml @@ -101,6 +101,7 @@ jobs: - name: Summarize gRPC failures if: ${{ always() && (steps.grpc.outcome == 'failure' || steps.grpc-tests.outcome == 'failure') }} run: | + echo "::notice::gRPC tests are non-blocking due to missing/broken gRPC on PHP 8.5." { echo "### gRPC tests are non-blocking" echo