Skip to content

ci: deploy docs via Ddraig SSG (#59) #105

ci: deploy docs via Ddraig SSG (#59)

ci: deploy docs via Ddraig SSG (#59) #105

# SPDX-License-Identifier: MPL-2.0
# Copyright (c) 2026 Jonathan D.A. Jewell (hyperpolymath) <j.d.a.jewell@open.ac.uk>
#
# perf-regression.yml — Phase D performance regression gate (standards#99)
#
# Runs the Benchee harness in bench/gateway_latency.exs and diffs the
# resulting percentiles against the checked-in bench/baseline.json via
# bench/compare.exs.
#
# Modes (driven by baseline.json `_status`):
# • scaffold-placeholder — report-only, never fails the build (current).
# • active — fails the PR when p50/p95/p99 regress past
# the tolerance ratios in baseline.json.
#
# This is the regression-alert leg of Phase D — see
# docs/perf-contract.md for the published SLO contract and
# standards#91 for the single-lane HCG channel ordering.
name: Perf Regression
on:
pull_request:
branches: ['**']
push:
branches: [main, master]
workflow_dispatch:
# Estate guardrail (standards#122): cancel superseded runs so re-pushes
# don't pile up against the account-wide Actions concurrency pool. Safe
# here because the workflow is read-only (no publish, no mutation).
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
permissions:
contents: read
pull-requests: write # Required to post the regression-report comment.
jobs:
bench:
name: Gateway latency benchmark
runs-on: ubuntu-latest
timeout-minutes: 15
steps:
- name: Checkout repository
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- name: Setup Elixir/OTP
uses: erlef/setup-beam@fc68ffb90438ef2936bbb3251622353b3dcb2f93 # v1.18.2
with:
# Pinned to match .tool-versions; bump both together.
elixir-version: '1.19'
otp-version: '28'
- name: Cache deps
uses: actions/cache@5a3ec84eff668545956fd18022155c47e93e2684 # v4.2.3
with:
path: |
deps
_build
key: ${{ runner.os }}-perf-${{ hashFiles('mix.lock') }}
restore-keys: |
${{ runner.os }}-perf-
- name: Install deps
run: |
mix local.hex --force
mix local.rebar --force
mix deps.get
- name: Compile
run: mix compile --warnings-as-errors
- name: Run benchmark harness
run: mix run bench/gateway_latency.exs | tee bench/console.log
- name: Compare against baseline
id: compare
run: |
# bench/compare.exs writes the markdown table to stdout and
# exits non-zero on regression (active mode) or zero (scaffold mode).
mix run bench/compare.exs | tee -a "$GITHUB_STEP_SUMMARY"
- name: Upload bench artefacts
if: always()
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
with:
name: perf-regression-results
path: |
bench/results.json
bench/console.log
retention-days: 30