One-line CI for Solana compute-unit profiling. Wraps the
cu-profiler CLI: it downloads a
checksum-verified prebuilt binary, profiles your scenarios, fails the build on
budget breaches or regressions, and posts the report as a sticky comment on the
pull request.
- uses: MerlijnW70/cu-profiler-action@v1
with:
baseline: .cu/baseline.json
fail-on-regression: trueNo cargo install, no toolchain — a prebuilt binary is fetched and verified
(SHA-256) for the runner's OS/arch in seconds.
- Resolves the runner platform → release target and downloads the matching
cu-profilerbinary, verifying its SHA-256 (refuses a tampered binary). - Runs the profiler over your recorded scenarios.
- Renders a Markdown report → sticky PR comment + the job step summary, and uploads it as an artifact.
- Fails the job when a budget or regression gate trips (stable exit codes).
The profiler reads recorded logs (
.cu/logs/*.log) or imported transactions — produce them in an earlier step (your test harness, Mollusk, or committed fixtures). This action profiles and gates; it does not execute your program.
| Input | Default | Description |
|---|---|---|
version |
0.1.2 |
CLI version — a pinned version for reproducibility, or latest. |
config |
cu-profiler.toml |
Path to the config. |
logs-dir |
.cu/logs |
Recorded <scenario>.log directory. |
scenario |
(all) | Limit to these scenario names (whitespace-separated). |
tag |
(all) | Limit to scenarios with these tags. |
baseline |
(none) | Baseline JSON to compare against (enables regression gating). |
strict |
false |
Treat low-confidence measurements as failures. |
fail-on-budget |
true |
Fail when an absolute budget is exceeded. |
fail-on-regression |
true |
Fail on a compute regression vs baseline. |
fail-on-low-confidence |
false |
Fail on low-confidence measurements. |
comment-on-pr |
true |
Post/update a sticky report comment on the PR. |
comment-tag |
default |
Sticky-comment identifier (one comment per tag). |
upload-artifact |
true |
Upload the rendered report as an artifact. |
working-directory |
. |
Directory to run in. |
github-token |
${{ github.token }} |
Token used to post the PR comment. |
| Output | Description |
|---|---|
exit-code |
The cu-profiler exit code (0 pass; 1–6 per the CI docs). |
outcome |
pass or fail. |
report-path |
Path to the rendered Markdown report. |
name: CU Profiler
on:
pull_request:
permissions:
contents: read
pull-requests: write # required for the sticky PR comment
jobs:
cu:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
# ... a step here that produces .cu/logs/*.log ...
- uses: MerlijnW70/cu-profiler-action@v1
with:
baseline: .cu/baseline.json
fail-on-budget: true
fail-on-regression: trueubuntu-* (x86_64), windows-* (x86_64), and macos-14/Apple-Silicon
(arm64). macOS Intel (macos-13) support tracks the matching release binary.
On an unsupported platform the action fails with a clear message; install from
source (cargo install cu-profiler-cli) instead.
The action's @v1 tag is independent of the CLI's version. By default it uses a
pinned CLI version (reproducible); set version: latest to always pull the
newest release.
MIT OR Apache-2.0.