GitHub Action¶
Use bagx-action to run bagx in CI without hand-writing workflow steps.
Install¶
The action is a thin composite wrapper: install bagx from PyPI, then call the CLI.
Benchmark gate¶
See benchmark for manifest format.
PR readiness diff¶
On pull requests the action:
- Runs
bagx evalon the configured bag - Restores a baseline eval JSON from
actions/cache(keyed on the PR base SHA) - Runs
bagx diff --format markdownand posts a sticky PR comment - Fails when
--exit-onseverity is reached
Prime the cache on main:
on:
push:
branches: [main]
jobs:
prime:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: rsasaki0109/bagx-action@v1
with:
bags: bag/recording.db3
comment: "false"
- run: cp .bagx-action/current.json .bagx-action/baseline.json
- uses: actions/cache/save@v4
with:
path: .bagx-action/baseline.json
key: bagx-eval-baseline-${{ github.sha }}
Static HTML in CI¶
Combine with bagx eval --html in a custom step, or convert a saved JSON report:
- run: bagx eval bag.db3 --json report.json --html report.html
- uses: actions/upload-artifact@v4
with:
name: bagx-report
path: report.html
Workflow templates¶
Older copy-paste templates live under examples/github_actions/ in the bagx repo.
Prefer bagx-action for new workflows.
Dogfooding¶
The bagx repository runs bagx-action in .github/workflows/bagx-action-smoke.yml
against a synthetic benchmark suite generated by scripts/prepare_ci_benchmark.py.