Add new benchmark operations #56
Workflow file for this run
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: CI | |
| on: | |
| push: | |
| branches: | |
| - trunk | |
| pull_request: | |
| concurrency: | |
| group: ci-${{ github.ref }} | |
| cancel-in-progress: true | |
| jobs: | |
| js: | |
| name: Lint, typecheck, Jest | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 40 | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: actions/setup-node@v4 | |
| with: | |
| node-version: 20 | |
| cache: npm | |
| cache-dependency-path: | | |
| package-lock.json | |
| gutenberg/package-lock.json | |
| - name: Install plugin dependencies | |
| run: npm ci | |
| # Jest and typecheck resolve @wordpress/sync + yjs from the vendored | |
| # subtree, which is committed source-only. --ignore-scripts skips the | |
| # subtree's husky prepare hook (it errors outside a git root); the | |
| # lifecycle outputs it also skips are regenerated by `npm run build`. | |
| - name: Install and build the vendored Gutenberg subtree | |
| run: | | |
| cd gutenberg | |
| npm ci --ignore-scripts | |
| npm run build | |
| # PHP lint (composer lint) is deliberately absent: the plugin carries | |
| # documented pre-existing PHPCS debt (see AGENTS.md known issues). | |
| - name: Lint | |
| run: npm run lint:js | |
| - name: Typecheck | |
| run: npm run typecheck | |
| - name: Jest | |
| run: npm run test:js | |
| - name: Build the plugin bundle | |
| run: npm run build | |
| php: | |
| name: PHPUnit (wp-env) | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 30 | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: actions/setup-node@v4 | |
| with: | |
| node-version: 20 | |
| cache: npm | |
| cache-dependency-path: | | |
| package-lock.json | |
| gutenberg/package-lock.json | |
| - name: Install plugin dependencies | |
| run: npm ci | |
| # An UNBUILT gutenberg.php refuses to load its lib/ (the framework), | |
| # so the plugin under test finds no WP_Sync_* contracts and the | |
| # PHPUnit bootstrap dies with "Interface WP_Sync_Engine not found". | |
| # The subtree build is required even for the PHP-only test path. | |
| - name: Install and build the vendored Gutenberg subtree | |
| run: | | |
| cd gutenberg | |
| npm ci --ignore-scripts | |
| npm run build | |
| # The conformance suites run on the runner's PHP directly (no | |
| # WordPress). automerge-php's grapheme-cluster paths need the fixed | |
| # GB11 rules of PCRE2 >= 10.43, which PHP bundles from 8.4 — under | |
| # PHP <= 8.3 (PCRE2 10.42, including the stock runner PHP) two | |
| # adjacent emoji-ZWJ sequences count as ONE \X cluster and exactly | |
| # 2 of its 680 tests fail. Pin 8.4. | |
| - name: Set up PHP for the conformance suites | |
| uses: shivammathur/setup-php@v2 | |
| with: | |
| php-version: '8.4' | |
| extensions: mbstring | |
| tools: composer | |
| - name: Install PHP dependencies | |
| run: composer install --no-progress | |
| # The vendored y-php library's own conformance suite: translated | |
| # upstream Yjs tests plus byte-level fixtures generated from the JS | |
| # implementation. | |
| - name: y-php conformance | |
| run: | | |
| composer --working-dir=includes/lib/y-php install --no-progress | |
| composer --working-dir=includes/lib/y-php test | |
| # The vendored automerge-php library's own conformance suite: | |
| # ported upstream Automerge JS/Rust tests (680 mapped). Needs no | |
| # Composer install (hand-rolled runner). The runner exits non-zero | |
| # on any failing test; keep its report visible either way. | |
| - name: automerge-php conformance | |
| run: | | |
| status=0 | |
| php includes/lib/automerge-php/tests/run.php > automerge-conformance.json || status=$? | |
| php -r ' | |
| $report = json_decode( (string) file_get_contents( "automerge-conformance.json" ), true ); | |
| if ( ! is_array( $report ) ) { | |
| echo "Runner produced no JSON report:\n"; | |
| echo file_get_contents( "automerge-conformance.json" ), "\n"; | |
| exit( 1 ); | |
| } | |
| printf( "passing=%d failing=%d (%s%%)\n", $report["passingTests"] ?? -1, $report["failingTests"] ?? -1, $report["passPercent"] ?? "?" ); | |
| ' | |
| if [ "$status" -ne 0 ]; then | |
| echo "=== failing tests ===" | |
| grep -B 8 '"passed": false' automerge-conformance.json || true | |
| fi | |
| exit "$status" | |
| # Tests target the dedicated tests environment (.wp-env.tests.json) | |
| # — the default .wp-env.json is the dev environment, whose afterStart | |
| # hook (the websocket daemon) has no business in CI. | |
| - name: Start wp-env (tests) | |
| run: npm run env:tests start | |
| - name: PHPUnit | |
| run: npm run test:php | |
| e2e: | |
| name: End-to-end (Playwright) | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 60 | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: actions/setup-node@v4 | |
| with: | |
| node-version: 20 | |
| cache: npm | |
| cache-dependency-path: | | |
| package-lock.json | |
| gutenberg/package-lock.json | |
| - name: Install plugin dependencies | |
| run: npm ci | |
| - name: Install and build the vendored Gutenberg subtree | |
| run: | | |
| cd gutenberg | |
| npm ci --ignore-scripts | |
| npm run build | |
| - name: Build the plugin bundle | |
| run: npm run build | |
| - name: Install Playwright browser | |
| run: npx playwright install --with-deps chromium | |
| - name: Start wp-env (tests) | |
| run: npm run env:tests start | |
| # The @wordpress/scripts base config applies 2 retries under CI, | |
| # which absorbs the suite's known under-load flake (a fixture login | |
| # navigation can time out in a full run; every spec is green solo — | |
| # see AGENTS.md). | |
| - name: Playwright | |
| run: npm run test:e2e | |
| # cancelled() covers timed-out runs, where we also want artifacts | |
| - name: Upload test artifacts | |
| if: failure() || cancelled() | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: e2e-artifacts | |
| path: artifacts/ | |
| retention-days: 7 |