File tree Expand file tree Collapse file tree 2 files changed +35
-0
lines changed Expand file tree Collapse file tree 2 files changed +35
-0
lines changed Original file line number Diff line number Diff line change @@ -130,6 +130,38 @@ jobs:
130130 - name : Test Program
131131 run : make test-program
132132
133+ bench_program_compute_units :
134+ name : Benchmark Program Compute Units
135+ runs-on : ubuntu-latest
136+ needs : build_program # Cargo Bench won't build the SBPF binary...
137+ steps :
138+ - name : Git Checkout
139+ uses : actions/checkout@v4
140+
141+ - name : Setup Environment
142+ uses : ./.github/actions/setup
143+ with :
144+ cargo-cache-key : cargo-program-benches
145+ cargo-cache-fallback-key : cargo-program
146+ solana : true
147+
148+ - name : Restore Program Builds
149+ uses : actions/cache/restore@v4
150+ with :
151+ path : ./**/*.so
152+ key : ${{ runner.os }}-builds-${{ github.sha }}
153+
154+ - name : Benchmark Compute Units
155+ run : make bench-program-compute-units
156+
157+ - name : Check Working Directory
158+ run : |
159+ if [ -n "$(git status --porcelain)" ]; then
160+ test -z "$(git status --porcelain)"
161+ echo "CU usage has changed. Please run `cargo bench` and commit the new results.";
162+ exit 1;
163+ fi
164+
133165 generate_clients :
134166 name : Check Client Generation
135167 runs-on : ubuntu-latest
Original file line number Diff line number Diff line change @@ -32,6 +32,9 @@ test-%:
3232build-program :
3333 cargo test-sbf --manifest-path program/Cargo.toml --features bpf-entrypoint
3434
35+ bench-program-compute-units :
36+ cargo bench --manifest-path program/Cargo.toml
37+
3538format-js :
3639 cd ./clients/js && pnpm install && pnpm format
3740
You can’t perform that action at this time.
0 commit comments