-
-
Notifications
You must be signed in to change notification settings - Fork 450
Isolate grpc tests #1063
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Isolate grpc tests #1063
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Some comments aren't visible on the classic Files Changed page.
There are no files selected for viewing
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,127 @@ | ||
| 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.5) | ||
| runs-on: ubuntu-latest | ||
coderabbitai[bot] marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| # 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: | ||
| key: cache-grpc | ||
| php-version: 8.5 | ||
| extensions: grpc | ||
|
|
||
| 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= | ||
coderabbitai[bot] marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| tools: composer, pecl | ||
| coverage: xdebug | ||
|
|
||
| - name: Setup problem matchers for PHP | ||
| run: echo "::add-matcher::${{ runner.tool_cache }}/php.json" | ||
|
|
||
| - name: Verify gRPC extension | ||
| id: grpc | ||
| run: php -m | grep -i '^grpc$' | ||
|
|
||
| - 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}} | ||
| 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 --testsuite=integration --group grpc --coverage-clover=coverage.xml --log-junit=test-report.xml --testdox | ||
|
|
||
| - 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 | ||
| 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() && steps.grpc.outcome == 'success' }} | ||
| 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() && steps.grpc.outcome == 'success' }} | ||
| uses: codecov/codecov-action@v5 | ||
| with: | ||
| token: ${{ secrets.CODECOV_TOKEN }} | ||
| files: ./coverage.xml | ||
| flags: grpc | ||
| fail_ci_if_error: false | ||
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
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
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
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
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add
composer.lockto the workflow path filters.Line 7-20: dependency updates via
composer.lockalone won’t trigger these gRPC tests, so regressions can slip through. Add it to bothpull_requestandpushpath filters.🔧 Suggested diff
paths: - 'src/**' - 'tests/**' - '.github/workflows/grpc-tests.yml' - 'composer.json' + - 'composer.lock' - 'phpstan.neon.dist' ... paths: - 'src/**' - 'tests/**' - '.github/workflows/grpc-tests.yml' - 'composer.json' + - 'composer.lock' - 'phpstan.neon.dist'📝 Committable suggestion
🤖 Prompt for AI Agents