caffeine_lang/codegen/relay_workflow

Values

pub fn generate() -> String

Codegen for the GitHub Actions workflow that runs the bundled relay.

The output is a static YAML file the compiler dumps verbatim at .github/workflows/caffeine-relay.yml whenever any expectation uses external-signal indicators. The workflow:

  • fires every 5 minutes (cron) and on workflow_dispatch
  • uses a single-slot concurrency group so a slow run doesn’t overlap itself
  • installs Erlang + Gleam via erlef/setup-beam
  • restores the cursor file from GHA cache, then saves it back on exit so each run picks up where the last one stopped
  • invokes the bundled relay project via gleam run
  • pulls Langfuse and Datadog credentials from repo secrets

Paths assume the layout from codegen/relay (Task #5) and the bundled relay project from Task #7: build/relay/signals.json for the routing table and build/relay/relay/ for the Gleam project itself. Returns None when no relay is needed (the compiler decides based on whether any IR uses external-signal indicators). The wrapped string is the literal YAML the compiler writes to disk.

Search Document