-
-
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
base: 8.x
Are you sure you want to change the base?
Isolate grpc tests #1063
Changes from all commits
50adae4
bdc7b17
0017157
93e760d
d22ed5c
a81f660
ec42e92
b6ed7fc
c0309c9
83f0548
a2b955a
6df8ac8
386580f
0441e13
0dafd57
d19b03d
22edba9
b371850
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| @@ -0,0 +1,128 @@ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| name: gRPC Tests | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| on: | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| # 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/**' | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| - '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' | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Comment on lines
+7
to
+20
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Add Line 7-20: dependency updates via 🔧 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
Suggested change
🤖 Prompt for AI Agents |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 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 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -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] | ||
|
Comment on lines
+4
to
6
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Guard integration tests on forked PRs to avoid secret-less failures.
✅ Suggested guard to skip forked PRs jobs:
integration-tests:
+ if: ${{ github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name == github.repository }}
name: Integration Tests🤖 Prompt for AI Agents |
||
| paths: | ||
| - 'src/**' | ||
|
|
@@ -32,43 +33,27 @@ jobs: | |
| runs-on: ubuntu-latest | ||
|
|
||
| env: | ||
| php-version: '8.4' | ||
| extensions: grpc | ||
| key: cache-v1 | ||
| php-version: '8.5' | ||
|
|
||
| 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 }} | ||
| 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" | ||
| 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 +66,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() }} | ||
|
|
||
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.
Address the TODO before merging: revert
pull_requesttopull_request_target.Line 4 contains a reminder to revert the trigger type. Ensure this is completed before merging to maintain proper security boundaries for fork PRs accessing secrets.
🤖 Prompt for AI Agents