Merge pull request #82 from lezama/feat/a2a-agent-mesh #76
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: Tests | |
| on: | |
| pull_request: | |
| branches: [main] | |
| paths-ignore: | |
| - '**.md' | |
| - 'docs/**' | |
| - 'LICENSE' | |
| - '.distignore' | |
| - '.wordpress-org/**' | |
| push: | |
| branches: [main] | |
| workflow_dispatch: | |
| concurrency: | |
| group: tests-${{ github.ref }} | |
| cancel-in-progress: true | |
| jobs: | |
| phpunit: | |
| name: PHPUnit (PHP ${{ matrix.php }} / WP ${{ matrix.wp }}) | |
| runs-on: ubuntu-latest | |
| # Plugin requires WP 7.0+; trunk is the only viable target until 7.0 ships. | |
| continue-on-error: ${{ matrix.wp == 'trunk' }} | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| php: ['8.1', '8.2', '8.4'] | |
| wp: ['trunk'] | |
| services: | |
| mariadb: | |
| image: mariadb:lts | |
| env: | |
| MARIADB_ROOT_PASSWORD: root | |
| MARIADB_DATABASE: wordpress_test | |
| ports: | |
| - 3306:3306 | |
| options: >- | |
| --health-cmd="healthcheck.sh --connect --innodb_initialized" | |
| --health-interval=10s | |
| --health-timeout=5s | |
| --health-retries=5 | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v6 | |
| - name: Setup PHP | |
| uses: shivammathur/setup-php@v2 | |
| with: | |
| php-version: ${{ matrix.php }} | |
| extensions: mbstring, intl, zip, mysqli, pdo_sqlite | |
| tools: composer:v2 | |
| 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-${{ matrix.php }}-${{ hashFiles('**/composer.json') }} | |
| restore-keys: ${{ runner.os }}-composer-${{ matrix.php }}- | |
| - name: Install Composer dependencies | |
| run: composer install --prefer-dist --no-progress | |
| - name: Install subversion | |
| run: sudo apt-get update && sudo apt-get install -y subversion | |
| - name: Install WordPress test suite | |
| run: bash bin/install-wp-tests.sh wordpress_test root root 127.0.0.1 ${{ matrix.wp }} true | |
| - name: Run smoke tests (no WP required) | |
| run: php tests/smoke.php | |
| - name: Run PHPUnit (unit suite) | |
| run: vendor/bin/phpunit --testsuite unit | |
| - name: Run prompt-assembly snapshot suite | |
| # Fails the build if the assembled provider payload (system prompt, | |
| # tool catalog, model preference, runtime context) drifts from the | |
| # committed snapshot for any canonical (agent, channel) pair. | |
| # Update flow: `UPDATE_SNAPSHOTS=1 composer test:assembly` — the | |
| # regenerated snapshot then goes through PR review. | |
| run: composer test:assembly | |
| - name: Run PHPUnit (integration suite) | |
| if: hashFiles('tests/integration/**') != '' | |
| run: vendor/bin/phpunit --testsuite integration | |
| static-analysis: | |
| name: Static Analysis (PHPCS + PHPStan) | |
| runs-on: ubuntu-latest | |
| # The codebase predates WPCS/PHPStan adoption. PHPCS + PHPStan steps | |
| # are continue-on-error so violations surface as job logs but do not | |
| # fail the PR check until the backlog is burned down. | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v6 | |
| - name: Setup PHP | |
| uses: shivammathur/setup-php@v2 | |
| with: | |
| php-version: '8.2' | |
| extensions: mbstring | |
| tools: composer:v2 | |
| 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-static-${{ hashFiles('**/composer.json') }} | |
| restore-keys: ${{ runner.os }}-composer-static- | |
| - name: Install Composer dependencies | |
| run: composer install --prefer-dist --no-progress | |
| - name: Run PHPCS | |
| continue-on-error: true | |
| run: vendor/bin/phpcs -q --report=full --report-summary | |
| - name: Run PHPStan | |
| continue-on-error: true | |
| run: vendor/bin/phpstan analyse --error-format=github --no-progress |