Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 23 additions & 7 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,9 +48,14 @@ jobs:
github-token: ${{ secrets.GITHUB_TOKEN }}

e2e:
name: E2E (Node 22)
name: E2E (shard ${{ matrix.shard }}/3, Node 22)
runs-on: ubuntu-latest
timeout-minutes: 45
timeout-minutes: 15

strategy:
fail-fast: false
matrix:
shard: [1, 2, 3]

steps:
- uses: actions/checkout@v6
Expand All @@ -59,14 +64,20 @@ jobs:
with:
node-version: 22

- name: Set up PHP
uses: shivammathur/setup-php@v2
with:
php-version: '8.2'
tools: composer

- run: npm ci --no-audit

- name: Install plugin npm dependencies
run: npm ci --no-audit
working-directory: wordpress-plugin

- run: npx playwright install --with-deps chromium
- run: npm run test:e2e
- run: npm run test:e2e -- --shard=${{ matrix.shard }}/3

plugin-lint-php:
name: Plugin PHP Lint
Expand Down Expand Up @@ -115,20 +126,25 @@ jobs:
run: npm ci --no-audit
working-directory: wordpress-plugin

- name: Set up PHP
uses: shivammathur/setup-php@v2
with:
php-version: '8.2'
tools: composer

- name: Run PHPUnit with coverage
run: npm run test:php:coverage
working-directory: wordpress-plugin
run: npm run test:plugin-php:coverage

- name: Convert Clover XML to LCOV
uses: andstor/clover2lcov-action@v1
with:
src: wordpress-plugin/coverage/clover.xml
dst: wordpress-plugin/coverage/lcov.info

- name: Rewrite container paths in LCOV
- name: Rewrite VFS paths in LCOV
run: >-
sed -i
's|SF:/var/www/html/wp-content/plugins/claudaborative-editing/|SF:wordpress-plugin/|g'
's|SF:/wordpress/wp-content/plugins/claudaborative-editing/|SF:wordpress-plugin/|g'
wordpress-plugin/coverage/lcov.info

- name: Check PHP coverage
Expand Down
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,11 @@ coverage/
.gutenberg/
test-results/
.DS_Store
.claude/
wordpress-plugin/build/
wordpress-plugin/node_modules/
wordpress-plugin/vendor/
wordpress-plugin/.wp-tests-lib/
wordpress-plugin/.phpcs-cache
wordpress-plugin/.phpstan-cache
wordpress-plugin/.phpunit.cache
Expand Down
4 changes: 3 additions & 1 deletion .markdownlint-cli2.jsonc
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@
"test-results/",
"wordpress-plugin/node_modules/",
"wordpress-plugin/vendor/",
"wordpress-plugin/build/"
"wordpress-plugin/build/",
"wordpress-plugin/coverage/",
"wordpress-plugin/.wp-tests-lib/"
]
}
2 changes: 2 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,6 @@ test-results/
wordpress-plugin/vendor/
wordpress-plugin/node_modules/
wordpress-plugin/build/
wordpress-plugin/coverage/
wordpress-plugin/.wp-tests-lib/
tests/fixtures/
13 changes: 0 additions & 13 deletions .wp-env.json

This file was deleted.

15 changes: 0 additions & 15 deletions .wp-env.test.json

This file was deleted.

12 changes: 11 additions & 1 deletion CLAUDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ npm run typecheck # TypeScript type check
npm run lint # ESLint + markdownlint + Prettier check
npm run lint:fix # Auto-fix all lint and formatting issues
npm run dev # Watch mode build
npm run dev:wp # Start a local WordPress on http://127.0.0.1:9400 via wp-playground-cli (ephemeral, Gutenberg latest, collab enabled)
```

## Git Hooks
Expand Down Expand Up @@ -135,7 +136,16 @@ composer phpstan # PHPStan static analysis (level 7)

```bash
cd wordpress-plugin && npm run test # TypeScript tests
cd wordpress-plugin && npm run test:php # PHPUnit tests (requires wp-env)
npm run test:plugin-php # PHPUnit tests (runs in wp-playground-cli, from repo root)
```

PHPUnit runs inside `@wp-playground/cli` (PHP-WASM + SQLite). The first run
clones `tests/phpunit` from `wordpress-develop` into
`wordpress-plugin/.wp-tests-lib/` (gitignored). Activation is handled by
`playground/phpunit.blueprint.json`; config is in
`wordpress-plugin/tests/wp-tests-config.php`. The test library's default install
path (which forks a PHP subprocess via `system()`) is skipped with
`WP_TESTS_SKIP_INSTALL=1` because Playground already provides a fresh SQLite DB
per boot.

Run `npm run lint` from the repo root to lint everything (ESLint + stylelint + markdownlint + Prettier).
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,7 @@ npm test # Run vitest
npm run typecheck # TypeScript type check
npm run lint # ESLint + markdownlint + Prettier check
npm run dev # Watch mode build
npm run dev:wp # Start a local WordPress via wp-playground-cli (no Docker)
```

### WordPress plugin
Expand Down
15 changes: 0 additions & 15 deletions bin/after-start-dev.sh

This file was deleted.

9 changes: 0 additions & 9 deletions bin/after-start-e2e.sh

This file was deleted.

2 changes: 2 additions & 0 deletions eslint.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@ export default [
'wordpress-plugin/vendor/**',
'wordpress-plugin/node_modules/**',
'wordpress-plugin/build/**',
'wordpress-plugin/coverage/**',
'wordpress-plugin/.wp-tests-lib/**',
],
},

Expand Down
Loading
Loading