From c9a0226042e3fc9a44b7d842a16b0aaf1af053af Mon Sep 17 00:00:00 2001 From: Rory Graves Date: Mon, 15 Jun 2026 12:23:55 +0100 Subject: [PATCH 1/2] ci: add bench smoke workflow for non-aggregated bench module Adds .github/workflows/bench.yml, the only automated gate that builds the sbt-jmh bench module (excluded from ciCheck via non-aggregation). Triggers on workflow_dispatch, a weekly cron, and PRs touching bench or any depended-on module/build path. Smoke-runs every bench (no name filter, no -t flag) with minimal iterations to prove the harness still compiles and runs. --- .github/workflows/bench.yml | 60 +++++++++++++++++++++++++++++++++++++ 1 file changed, 60 insertions(+) create mode 100644 .github/workflows/bench.yml diff --git a/.github/workflows/bench.yml b/.github/workflows/bench.yml new file mode 100644 index 0000000..09ea880 --- /dev/null +++ b/.github/workflows/bench.yml @@ -0,0 +1,60 @@ +name: Bench Smoke + +# Dedicated gate for the non-aggregated `bench` (sbt-jmh) module. Because +# `bench` is intentionally excluded from `root.aggregate(...)`, the normal CI +# (`ciCheck`) never compiles/tests/lints it — this workflow is the ONLY +# automated gate that builds the benchmarks. It runs every bench present (no +# benchmark-name filter) as a smoke test: prove the harness still compiles and +# runs. There is no score threshold; only compile/run errors fail the job. +# Full benchmark runs and baseline regeneration stay manual. + +on: + workflow_dispatch: + schedule: + # Weekly, Monday 06:00 UTC — catches drift in depended-on modules. + - cron: '0 6 * * 1' + pull_request: + # Broad path filter: an API or build change in any depended-on module can + # break the benches, and since `bench` is outside `ciCheck` it would + # otherwise go unnoticed until the weekly run. + paths: + - 'modules/termflow-bench/**' + - 'modules/termflow-screen/**' + - 'modules/termflow-app/**' + - 'modules/termflow-widgets/**' + - 'modules/termflow-sample/**' + - 'modules/termflow-testkit/**' + - 'build.sbt' + - 'project/**' + - '.github/workflows/bench.yml' + +# Prevent overlapping runs for the same ref. +concurrency: + group: ${{ github.workflow }}-${{ github.event_name == 'pull_request' && github.head_ref || github.ref }} + cancel-in-progress: ${{ github.event_name == 'pull_request' }} + +jobs: + bench-smoke: + runs-on: ubuntu-latest + permissions: + contents: read + + steps: + - uses: actions/checkout@v5 + + - name: Setup Java + uses: actions/setup-java@v5 + with: + distribution: temurin + java-version: 21 + cache: sbt + + - name: Setup sbt + uses: sbt/setup-sbt@v1 + + - name: JMH smoke run (every bench, minimal iterations) + # No benchmark-name filter -> runs whatever benches are present, so this + # stays forward-compatible as more bench classes land. No `-t` thread + # flag: benches that mutate per-invocation state self-pin with + # @Threads(1) + @State(Scope.Thread) in their own source. + run: sbt --batch "bench/Jmh/run -i 1 -wi 1 -f1 -r 1 -w 1" From 5ee2172aeed4d8a17e6e525620b463cba7f2d8b6 Mon Sep 17 00:00:00 2001 From: Rory Graves Date: Mon, 15 Jun 2026 12:27:23 +0100 Subject: [PATCH 2/2] bench CI: include termflow-terminal in smoke path filter bench transitively depends on termflow-terminal via screen/app/widgets/ sample/testkit, so a terminal-only PR could break the benches without triggering the smoke gate until the weekly run. Addresses codex P2. --- .github/workflows/bench.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/bench.yml b/.github/workflows/bench.yml index 09ea880..6dc8c9c 100644 --- a/.github/workflows/bench.yml +++ b/.github/workflows/bench.yml @@ -19,6 +19,7 @@ on: # otherwise go unnoticed until the weekly run. paths: - 'modules/termflow-bench/**' + - 'modules/termflow-terminal/**' - 'modules/termflow-screen/**' - 'modules/termflow-app/**' - 'modules/termflow-widgets/**'