Skip to main content

Module workflow

Module workflow 

Source
Expand description

Workflow guard — keep the reusable workflow in step with the CLI (issue #92).

The reusable workflow (.github/workflows/testing-conventions.yml) is the documented @v0 consumption path: a consumer pins @v0, and the workflow runs the published testing-conventions binary via npx. When a CLI subcommand is renamed or removed — e.g. unit locationunit colocated-test (#55) — but a workflow still invokes the old name, every @v0 consumer breaks with unrecognized subcommand, silently: the workflow file is frozen at the tag while npx keeps pulling the latest binary.

This module is the deterministic guard against that drift. invocations extracts every testing-conventions … call from a workflow file’s shell, and unknown_subcommands checks each one’s subcommand chain against the binary’s own command tree (the source of truth, crate::command), flagging any chain the binary no longer exposes. Run in CI against the reusable workflow it fails the build the moment a workflow and the CLI fall out of step — before a release can strand @v0.

Extraction is a line-based, shell-aware scan, not a full GitHub Actions parser: it tokenizes each non-comment line, finds the testing-conventions binary token (the bare command word, optionally version-pinned …@x / …${VERSION:+@$VERSION} — the npx / on-PATH form the reusable workflow and the docs use), and reads the tokens after it as the invocation. That is the deterministic bright-line; a path-qualified invocation (./bin/testing-conventions), a subcommand split across a \-continuation, or one named in non-run: prose is a documented limit.

Structs§

Invocation
A single testing-conventions invocation found in a workflow file.

Functions§

check
Check path (a workflow file or directory): every testing-conventions invocation must name a subcommand root still exposes. Returns one Violation per offending invocation.
invocations
Walk path — a workflow file, or a directory of them — and return every testing-conventions invocation, in file-then-line order.
unknown_subcommands
Of invocations, the ones whose subcommand chain names a subcommand the binary — described by root, its clap command tree — no longer exposes.