fix: verify comments that do not arrive through wp-comments-post.php
#48
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
| # Split out of the former `tests.yml`, like the unit and end-to-end workflows. The job is | |
| # named `test-integration`, matching the naming of the other test jobs. | |
| # | |
| # The suite runs through PHPUnit but needs a real WordPress, a database and the WordPress | |
| # PHPUnit test library, so it starts `wp-env` the way the end-to-end workflow does. That | |
| # makes it more expensive than the unit suite and cheaper than the nine-wide end-to-end | |
| # matrix, so it gets a path filter of its own rather than sharing either of theirs. | |
| # | |
| # Only `pull_request` is filtered — `push` to a major branch deliberately runs everything. | |
| # A merge carries the same diff the pull request carried, so a filter that is too narrow | |
| # would skip the check on the pull request *and* on the merge, and the gap would never | |
| # surface. The push run is also the only one that tests the code as it actually landed: | |
| # pull request checks run against a merge commit computed when they started, which goes | |
| # stale once the base branch moves on. | |
| name: Integration tests | |
| on: | |
| push: | |
| branches: | |
| - master | |
| - v3 | |
| pull_request: | |
| paths: | |
| - '**.php' | |
| # The end-to-end suite drives a browser and cannot affect a PHPUnit run, so exclude it | |
| # from the `**.php` match above. | |
| - '!tests/e2e/**' | |
| - 'composer.json' | |
| - 'composer.lock' | |
| - 'package.json' | |
| - 'package-lock.json' | |
| - 'phpunit-integration.xml.dist' | |
| - 'tests/Integration/**' | |
| - 'tests/integration-bootstrap.php' | |
| - '.wp-env.json' | |
| - '.github/workflows/integration.yml' | |
| # The shared PHP setup is part of this workflow's setup, so a change to it has to run | |
| # this workflow as well. | |
| - '.github/actions/setup-php/**' | |
| # Allow forcing a full run by hand, for example before cutting a release. | |
| workflow_dispatch: | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.ref }} | |
| cancel-in-progress: true | |
| jobs: | |
| test-integration: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 | |
| - name: Setup Node.js | |
| uses: actions/setup-node@249970729cb0ef3589644e2896645e5dc5ba9c38 # v6.5.0 | |
| with: | |
| node-version: '22' | |
| cache: 'npm' | |
| - name: Install npm dependencies | |
| run: npm ci | |
| # The dev dependencies are required: the suite runs through PHPUnit. | |
| - name: Setup PHP and install dependencies | |
| uses: ./.github/actions/setup-php | |
| with: | |
| php-version: '8.2' | |
| # Provides WordPress, the database and the WordPress PHPUnit test library. | |
| - name: Start wp-env | |
| run: npm run env:start | |
| - name: Run integration tests | |
| run: npm run test:integration | |
| - name: Run integration tests on multisite | |
| run: npm run test:integration:multisite | |
| - name: Stop wp-env | |
| if: always() | |
| run: npm run env:stop |