Skip to content

MerlijnW70/cu-profiler-action

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

cu-profiler-action

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: true

No cargo install, no toolchain — a prebuilt binary is fetched and verified (SHA-256) for the runner's OS/arch in seconds.

What it does

  1. Resolves the runner platform → release target and downloads the matching cu-profiler binary, verifying its SHA-256 (refuses a tampered binary).
  2. Runs the profiler over your recorded scenarios.
  3. Renders a Markdown report → sticky PR comment + the job step summary, and uploads it as an artifact.
  4. 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.

Inputs

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.

Outputs

Output Description
exit-code The cu-profiler exit code (0 pass; 16 per the CI docs).
outcome pass or fail.
report-path Path to the rendered Markdown report.

Example

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: true

Supported runners

ubuntu-* (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.

Versioning

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.

License

MIT OR Apache-2.0.

About

One-line CI for Solana compute-unit profiling — gate on budgets/regressions and comment the report on the PR.

Resources

License

Unknown, MIT licenses found

Licenses found

Unknown
LICENSE-APACHE
MIT
LICENSE-MIT

Stars

Watchers

Forks

Packages

 
 
 

Contributors

Languages