ci: build from refs - #11
Conversation
… step summaries The dispatch workflow had never run, and couldn't have: it pinned OTP 27.3.3 while Lightning pins 28.5, and lacked libsodium-dev for enacl. Instead of re-pinning, read Erlang/Elixir/node from the checkout's own .tool-versions via setup-beam/setup-node version-file, so a Lightning bump can't silently break it. Lightning is now cloned with actions/checkout into .cache/lightning and passed to the harness as a local path — the checkout exists before any later step, so cache keys can hashFiles() against it when caching lands. Harness side: `up` now preflights the host toolchain against .tool-versions and fails with an install hint, rather than three steps later with mix exiting 126. Boot failures and failed-run assertions also mirror their explanation to $GITHUB_STEP_SUMMARY, so a red CI run explains itself on the summary page. Nothing is cached yet — this run establishes the cold-path baseline.
The flow, end to endThe workflow checks out this repo, then checks out Lightning (any ref/repo, Stopssrc/toolchain.ts
Elixir's version string embeds the OTP it was compiled for Diagnosis story: this file exists because src/ci.tsNine lines. The only reason it's its own file rather than inlined at the two .github/workflows/test-lightning-branch.ymlDiff-read this one, don't just read the final version — the previous version Two things worth checking closely:
|
|
There's deprecation warning on the action saying that node 20 is deprecated. Can we make sure the node actions are all on latest? |
|
There is so much noise from lightning and setup logging in the contract tests bit. The only test stuff runs on line 1487. Is there anything we can do about this? Disable logging? but that might be a problem for debug |
| @@ -1,10 +1,16 @@ | |||
| name: Test against a Lightning branch | |||
|
|
|||
| # Boots a real Lightning (built from the chosen ref) and a real ws-worker on | |||
There was a problem hiding this comment.
Is it time to update this workflow name? Or are we still treating this just as a test canary?
There was a problem hiding this comment.
Workflow name updated. Now looks something like below
OpenFn/lightning@main vs worker latest
deps.get, npm/pnpm install, and mix lightning.kickstart all ran with stdio: inherit, so a successful CI run's console was mostly dependency resolution noise and (for kickstart) every Ecto query at Lightning's dev debug level — the actual test result was buried under it. These commands now write to tmp/prep.log instead. Silent when they succeed; the accumulated log is dumped to the console and $GITHUB_STEP_SUMMARY the moment one fails, so the failure signal doesn't lose anything, only the noise around a pass does. Also uploaded as a CI artifact alongside lightning.log/worker.log. Verified: a full local run's console output dropped from several hundred lines to 25; a forced mix failure (bogus task name) still prints the real error and reaches the step summary.
Four comments referenced our own build process rather than what a reader needs (a specific error code we hit, a caching decision not yet made, a 'this run measures' aside about the PR's own rollout). Reworded to state what the code does and why, independent of how this PR came together.
Every workflow_dispatch run showed up identically in the Actions tab
('Test against a Lightning branch #N') until opened. run-name (the one
GitHub key documented to support the inputs context here) surfaces
lightning_repo@lightning_ref and the worker spec right in the list.

What this does
The CI workflow that's supposed to test any Lightning branch didn't actually
work. It had specific software versions typed into it by hand, and Lightning
has since moved on to newer ones. Instead of updating those by hand again
(which just breaks the next time Lightning upgrades), the workflow now reads
the required versions directly from whatever Lightning branch it's testing.
It also installs a system package Lightning needs that was missing before.
Separately, if someone runs this harness on a machine with the wrong software
versions installed, it now says so plainly and tells them how to fix it,
instead of failing with a cryptic error partway through.
How to use and test it
bun run typecheck LIGHTNING=../lightning WORKER=../kit bun run testExpect
✓ tests/happy-path.spec.ts (1 test), ~35s on a warm checkout.Preflight:
In CI:
Run #11
(ubuntu-latest):
setup-beamresolved Erlang/OTP 28 + Elixir 1.18.4 fromLightning's
.tool-versions,libsodium-devinstalled, suite passed —1 passed (1), 211s cold (no caching yet).Where to look, in order
— the spec for this PR. Lightning is checked out into
.cache/lightningwith
actions/checkout(not cloned by the harness), anderlef/setup-beam/
actions/setup-noderead its.tool-versionsdirectly(
version-type: strict, required when reading from a file).are hard failures; node is advisory only (a major-version skew — v22 vs a
v24 pin — works fine in practice, so it only warns).
stepSummary. A no-op outsideActions (checks
$GITHUB_STEP_SUMMARY), so it's safe to call from anywherewithout an environment check at each call site.
— the two places that now call
stepSummary: a boot failure (Lightning orworker dying/timing out) and a failed run assertion. Both already had a
formatted message; this just mirrors it to the summary page too.
now-stale note about needing
bootstrap-from-config(Kickstart is onLightning
mainas of this PR).