refactor(mcp): dedupe security and validator gates (#8457) #3224
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: Guides | |
| on: | |
| push: | |
| pull_request: | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }} | |
| cancel-in-progress: true | |
| permissions: | |
| contents: read | |
| env: | |
| COMPOSER_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| COVERAGE: '0' | |
| SYMFONY_DEPRECATIONS_HELPER: max[self]=0 | |
| jobs: | |
| docs: | |
| name: Test guides | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@d23441a48e516b6c34aea4fa41551a30e30af803 # v6.1.0 | |
| - name: Setup PHP with pre-release PECL extension | |
| uses: shivammathur/setup-php@f3e473d116dcccaddc5834248c87452386958240 # 2.37.2 | |
| with: | |
| php-version: 8.2 | |
| tools: pecl, composer:2.9.8 | |
| extensions: intl, bcmath, curl, openssl, mbstring, pdo_sqlite | |
| coverage: none | |
| ini-values: memory_limit=-1 | |
| - name: Get composer cache directory | |
| id: composercache | |
| run: echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT | |
| shell: bash | |
| - name: Global require pdg | |
| run: | | |
| cd $(composer -n config --global home) | |
| echo "{\"repositories\":[{\"type\":\"vcs\",\"url\":\"https://github.com/php-documentation-generator/php-documentation-generator\"}]}" > composer.json | |
| composer global config --no-plugins allow-plugins.symfony/runtime true | |
| # pdg has no usable tag, so the branch is pinned to a commit | |
| composer global require "php-documentation-generator/php-documentation-generator:dev-main#0d8dd6222ef14338d502294016a3a263437d6b7a" | |
| - name: Cache dependencies | |
| uses: actions/cache@caa296126883cff596d87d8935842f9db880ef25 # v5.1.0 | |
| with: | |
| path: ${{ steps.composercache.outputs.dir }} | |
| key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.json') }} | |
| restore-keys: ${{ runner.os }}-composer- | |
| - name: Install project dependencies | |
| working-directory: docs | |
| run: | | |
| composer global require soyuka/pmu:0.3.0 | |
| composer global config allow-plugins.soyuka/pmu true --no-interaction | |
| composer global link .. | |
| - name: Test guides | |
| working-directory: docs | |
| env: | |
| APP_DEBUG: 0 | |
| PDG_AUTOLOAD: ${{ github.workspace }}/docs/vendor/autoload.php | |
| KERNEL_CLASS: \ApiPlatform\Playground\Kernel | |
| run: | | |
| for d in guides/*.php; do | |
| rm -f var/*.db | |
| echo "Testing guide $d" | |
| pdg-phpunit $d || exit 1 | |
| exit_status=$? | |
| if [ $exit_status -ne 0 ]; then | |
| exit $exit_status | |
| fi | |
| done |