Recipes / Event-driven

Browser tests

Offload a Playwright e2e suite to the shipped `playwright-e2e` run — sharded across the Browser Rendering pool, results posted back as a Check Run.

Fires on Every PR push — wire it any of these ways:

  • Action recommended A ci.yml step dispatches the run — when it must interleave with other CI jobs or gate the PR.
  • Webhook The GitHub App webhook fires the run directly — no .github/workflows file, no GHA minutes. (opt-in via the request-e2e label; baseURL from CONFIG_KV)
  • Schedule pattern A Cloudflare Cron Trigger fires it on a wall-clock cadence — no GitHub event, no workflow file. (fan out against fixed environments on a cron)
Use case
Playwright e2e suite, sharded across the browser pool
FlareDispatch shape
1 typed run + dispatch
Plain GHA shape
1 workflow · matrix + merge-reports job

Source

The recommended FlareDispatch shape is shown first. Toggle to Without FlareDispatch to see the full GitHub Actions workflow a team would maintain to do the same job without it.

Action mode — triggered by a GitHub Actions workflow that calls the shipped run.
recipes/browser-tests/ci.yml
# Recipe: browser tests (Playwright e2e) on Cloudflare
#
# Use case: a Playwright suite that is slow and burns GHA minutes. Offload it
# to the shipped `playwright-e2e` run, which shards the suite across the
# Cloudflare Browser Rendering pool. GHA only fires the dispatch (~10 s) and
# the result comes back as a check-run.
#
# Mode: Action mode, fire-and-forget. See specs/04-gha-integration.md.
# Run:  playwright-e2e — see specs/02-runs.md#3-playwright-e2e.

name: e2e
on:
  pull_request:
    paths: ["apps/**", "packages/**"]

jobs:
  browser-tests:
    runs-on: ubuntu-latest
    steps:
      - uses: openhackersclub/flare-dispatch-action@v1
        with:
          run: playwright-e2e
          endpoint: ${{ vars.FLAREDISPATCH_ENDPOINT }}
          hmac-secret: ${{ secrets.FLAREDISPATCH_HMAC }}
          inputs: |
            {
              "repo": "${{ github.repository }}",
              "sha": "${{ github.sha }}",
              "baseURL": "https://staging.example.com",
              "shards": 4,
              "browserMode": "cf-browser-rendering",
              "uploadReport": true
            }

# Branch protection: require the check-run `flare-dispatch/playwright-e2e`,
# not this GHA job — the job succeeds the moment dispatch is accepted.