Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
40 changes: 40 additions & 0 deletions .github/justfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
# CI job bodies: each workflow job runs exactly one `gha::` recipe, so
# `just ci` is exactly CI and the workflow files carry no logic beyond
# environment setup.

set working-directory := '..'

# Wrap one recipe in a GitHub Actions log group (plain passthrough
# locally).
[private]
_step recipe:
#!/usr/bin/env bash
set -euo pipefail
if [ "${GITHUB_ACTIONS:-}" = "true" ]; then
echo "::group::just {{recipe}}"
status=0
just {{recipe}} || status=$?
echo "::endgroup::"
if [ $status -ne 0 ]; then
echo "::error title=just {{recipe}} failed::exit status $status"
exit $status
fi
else
just {{recipe}}
fi

# The native job: formatting, clippy, host-crate tests, WIT validation.
host-checks:
@just gha::_step fmt-check
@just gha::_step lint
@just gha::_step test
@just gha::_step wit-check

# The full verification matrix (`just all`) plus the fixture pipeline's
# JUnit demo artifacts (the #11 demo): the workflow's presentation steps
# render them into the job summary. The deliberate trap is the point -
# the summary shows a real failure row; the gate is the `all` step, and
# the fixture is *supposed* to fail, so the emitter is not a verdict.
verify:
@just gha::_step all
@just gha::_step emit-demo
17 changes: 7 additions & 10 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ jobs:
run: ./scripts/setup.sh && echo "$HOME/.local/bin" >> "$GITHUB_PATH"

- name: Host checks
run: just host-checks
run: just gha::host-checks

# The full verification matrix: component builds, all execution
# paths (host-embed runner, composed wasi:cli runner under wasmtime,
Expand Down Expand Up @@ -71,15 +71,12 @@ jobs:
run: ./scripts/setup.sh && echo "$HOME/.local/bin" >> "$GITHUB_PATH"

- name: Verification matrix
run: just all

# The #11 demo: the fixture pipeline's results, converted by
# `component-test emit junit`, rendered into the run's job summary
# by an off-the-shelf reporter. The fixture's deliberate trap
# appears as a real failure row; fail_on_failure stays off - the
# gate is `just all` above, and the fixture is *supposed* to fail.
- name: Emit JUnit (demo)
run: just emit-demo
# Includes the fixture pipeline's JUnit demo artifacts (the #11
# demo): the following steps render them into the job summary.
# The fixture's deliberate trap appears as a real failure row;
# fail_on_failure stays off - the gate is `just all` inside
# gha::verify, and the fixture is *supposed* to fail.
run: just gha::verify

- name: Aggregate the demo results into the job summary
# Dogfoods actions/aggregate (the #14 composite action): the
Expand Down
4 changes: 3 additions & 1 deletion AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,9 @@ Recipes live in the `justfile` (`just` lists them): `just test` (host
crates), `just test-wasm` (integration tests that execute built
components — `#[ignore]`d in plain `cargo test`), `just build`
(components), `just all` (the full matrix below), `just lock-check` /
`just lock-update`, `just wit-check`. The verify
`just lock-update`, `just wit-check`, `just check` (the fast host gate:
fmt, clippy, host tests, WIT), `just ci` (exactly what CI's gating jobs
run, via the gha module). The verify
recipes assert exit codes *and* diff runner/fold output byte-for-byte
against `expected/` — when you intentionally change output or suite
cases, regenerate the affected `expected/` files and review the diff.
Expand Down
20 changes: 16 additions & 4 deletions justfile
Original file line number Diff line number Diff line change
@@ -1,18 +1,30 @@
# component-test task runner. `just` lists recipes; `just all` is the
# full verification matrix from AGENTS.md.
# full verification matrix from AGENTS.md. CI job bodies live in the gha
# module (`.github/justfile`); `just ci` mirrors the gating CI jobs.

wasm_target := "wasm32-wasip2"
release_dir := "target" / wasm_target / "release"
wasmtime_flags := "-W component-model-async -S p3"

_default:
# GitHub Actions plumbing: CI job entry points.
mod gha '.github'

# List the available recipes.
default:
@just --list --unsorted

# The exact set of checks CI runs: each gating CI job runs exactly one
# gha:: job recipe. The actions-setup-smoke job is excluded: it tests
# the actions/setup composite action and only runs under Actions.
ci: (gha::host-checks) (gha::verify)

# Everything: host tests, component builds, all verification paths.
all: build test test-wasm lock-check verify-embed verify-compose verify-deltic verify-pipeline verify-aggregate verify-viewer verify-imports verify-emit

# CI's native job: formatting, clippy, host tests, WIT validation.
host-checks: fmt-check lint test wit-check
# The fast pre-commit checks: formatting, clippy, host tests, WIT
# validation. The CI job of the same name runs the identical set
# through gha::host-checks.
check: fmt-check lint test wit-check

fmt-check:
cargo fmt --all --check
Expand Down
Loading