Recipes / Event-driven

CDP acceptance

Boot an app, drive it over the Chrome DevTools Protocol, and assert on network / console / heap observations using the `cdp-acceptance` 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 pattern The GitHub App webhook fires the run directly — no .github/workflows file, no GHA minutes. (needs app boot + target from config)
Use case
Boot an app, drive it over CDP, assert on observations
FlareDispatch shape
1 typed run + dispatch
Plain GHA shape
1 workflow · 1 job · 10+ steps with detach/wait/cleanup

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/cdp-acceptance/ci.yml
# Recipe: CDP acceptance tests on Cloudflare
#
# Use case: acceptance tests that boot the app under test and drive it via
# the Chrome DevTools Protocol — asserting on network calls, console errors,
# document counts, heap deltas. Offload to the shipped `cdp-acceptance` run,
# which boots the app in a container and attaches Browser Rendering over CDP.
#
# Mode: Action mode, await — a follow-up deploy gate needs the result inline.
#       See specs/04-gha-integration.md#await-sub-mode.
# Run:  cdp-acceptance — see specs/02-runs.md#4-cdp-acceptance.

name: acceptance
on:
  pull_request:
    paths: ["apps/**"]

jobs:
  cdp-acceptance:
    runs-on: ubuntu-latest
    steps:
      - uses: openhackersclub/flare-dispatch-action@v1
        with:
          run: cdp-acceptance
          endpoint: ${{ vars.FLAREDISPATCH_ENDPOINT }}
          hmac-secret: ${{ secrets.FLAREDISPATCH_HMAC }}
          mode: await
          timeout: 30m   # must be >= the cdp-acceptance run's maxDurationSec (1800s)
          inputs: |
            {
              "repo": "${{ github.repository }}",
              "sha": "${{ github.sha }}",
              "appBootCommand": "pnpm dev",
              "appPort": 4173,
              "testCommand": "pnpm test:acceptance"
            }

# In await mode the action mirrors the run's conclusion onto this GHA step,
# so a subsequent deploy job can `needs:` it.