GitHub Action
Vizb provides a composite GitHub Action to run benchmarks and generate visualizations in CI. Add it to any workflow with a single step.
Basic Usage
Section titled “Basic Usage”- uses: actions/setup-go@v6 with: go-version-file: go.mod
- uses: goptics/vizb@v0 with: bench-cmd: "go test -bench=." output-html: pages/index.htmlVersioning
Section titled “Versioning”Use goptics/vizb@v0 to automatically resolve to the latest v0.x.x release:
- uses: goptics/vizb@v0 # auto-resolves to latest v0.x.xThe action:
- Resolves the major version tag to the latest patch release
- Caches the downloaded binary across runs
- Falls back to the exact tag for non-major refs (e.g.,
@v0.10.3)
Inputs
Section titled “Inputs”| Input | Default | Description |
|---|---|---|
bench-cmd | "" | Benchmark command to run (e.g., go test -bench=.). Requires Go toolchain. |
bench-file | "" | Path to existing benchmark file. Takes priority over bench-cmd. |
name | "Benchmarks" | Benchmark name |
parser | "go" | Benchmark parser to use (one of: go, js:tinybench, js:vitest, rs:criterion and rs:divan) |
description | "" | Benchmark description |
tag | "" | Tag/identifier for the benchmark |
group-pattern | "x" | Group pattern |
group-regex | "" | Group regex |
scale | "linear" | Scale type: linear or log |
sort | "" | Sort order: asc or desc |
filter | "" | Regex filter for benchmark names |
mem-unit | "B" | Memory unit: b, B, KB, MB, GB |
time-unit | "ns" | Time unit: ns, us, ms, s |
number-unit | "" | Number unit: K, M, B, T |
charts | "bar,line,pie" | Chart types |
show-labels | "false" | Show labels on charts |
merge-files | "" | Space-separated JSON files to merge |
merge-dir | "" | Directory to scan for JSON files to merge |
tag-axis | "n" | Tag injection axis: n, x, or y |
output-json | "" | Path for JSON output file. Empty = skip JSON. |
output-html | "" | Path for HTML output file. Empty = skip HTML. |
data-url | "" | URL to fetch benchmark JSON from at runtime. When set, no input file is needed — the HTML fetches data remotely. The JSON host must serve Access-Control-Allow-Origin: *. |
Outputs
Section titled “Outputs”| Output | Description |
|---|---|
output-file-html | Path to the generated HTML file |
output-file-json | Path to the generated JSON file (same as output-json input) |
Input Resolution
Section titled “Input Resolution”The action resolves input in this priority order:
bench-file— if provided, uses the existing file directlybench-cmd— runs the command and captures output- Merge-only — if only
merge-filesormerge-diris provided, skips benchmarking
Minimal Examples
Section titled “Minimal Examples”Run benchmarks and generate HTML
Section titled “Run benchmarks and generate HTML”- uses: goptics/vizb@v0 with: bench-cmd: "go test -bench=." output-html: pages/index.htmlUse existing benchmark file
Section titled “Use existing benchmark file”- uses: goptics/vizb@v0 with: bench-file: bench-results.txt output-html: report.htmlGenerate HTML from remote data URL
Section titled “Generate HTML from remote data URL”- uses: goptics/vizb@v0 with: data-url: https://example.com/bench.json output-html: pages/index.htmlMerge and generate
Section titled “Merge and generate”- uses: goptics/vizb@v0 with: bench-cmd: "go test -bench=." merge-dir: previous-results/ tag: v1.2.0 tag-axis: x output-json: merged.json output-html: pages/index.html