Skip to content

Commit a3225ff

Browse files
kevinccbsgclaude
andcommitted
docs: document GitHub Action (composite run action) usage
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
1 parent bf74ada commit a3225ff

1 file changed

Lines changed: 37 additions & 0 deletions

File tree

README.md

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,3 +36,40 @@ Reads the same `twd.config.json` as `twd-cli` (coverage/contract keys are ignore
3636
| `launchArgs` | `[]` | Extra args passed to every browser launch |
3737

3838
If a configured browser isn't installed, the run prints `npx playwright install <browser>` and exits non-zero.
39+
40+
## GitHub Action
41+
42+
This repo ships a reusable composite action that caches the Playwright browsers, installs them, and runs `twd-runner` across the configured engines. Add `twd-runner` to your project's `devDependencies`, start your dev server, then call the action:
43+
44+
```yaml
45+
name: Cross-browser
46+
47+
on:
48+
push:
49+
branches: [main]
50+
pull_request:
51+
branches: [main]
52+
53+
jobs:
54+
cross-browser:
55+
runs-on: ubuntu-latest
56+
steps:
57+
- uses: actions/checkout@v5
58+
- uses: actions/setup-node@v5
59+
with:
60+
node-version: 24
61+
cache: npm
62+
- run: npm ci
63+
64+
- name: Start dev server
65+
run: |
66+
nohup npm run dev > dev.log 2>&1 &
67+
npx wait-on http://localhost:5173
68+
69+
- name: Run TWD tests across browsers
70+
uses: BRIKEV/twd-runner/.github/actions/run@main
71+
with:
72+
working-directory: . # directory containing twd.config.json (default ".")
73+
```
74+
75+
The action reads `twd.config.json` and runs every engine listed in `browsers` (default: chromium, firefox, webkit), exiting non-zero if any browser has a failing test.

0 commit comments

Comments
 (0)