@@ -130,6 +130,23 @@ jobs:
130130 - name : Build Program
131131 run : make build-program
132132
133+ build_program :
134+ name : Test Program
135+ runs-on : ubuntu-latest
136+ steps :
137+ - name : Git Checkout
138+ uses : actions/checkout@v4
139+
140+ - name : Setup Environment
141+ uses : ./.github/actions/setup
142+ with :
143+ toolchain : build
144+ cargo-cache-key : cargo-program
145+ solana : true
146+
147+ - name : Build Program
148+ run : make build-program
149+
133150 test_program :
134151 name : Test Program
135152 runs-on : ubuntu-latest
@@ -147,6 +164,38 @@ jobs:
147164 - name : Test Program
148165 run : make test-program
149166
167+ bench_program_compute_units :
168+ name : Benchmark Program Compute Units
169+ runs-on : ubuntu-latest
170+ needs : build_program # Cargo Bench won't build the SBPF binary...
171+ steps :
172+ - name : Git Checkout
173+ uses : actions/checkout@v4
174+
175+ - name : Setup Environment
176+ uses : ./.github/actions/setup
177+ with :
178+ cargo-cache-key : cargo-program-benches
179+ cargo-cache-fallback-key : cargo-program
180+ solana : true
181+
182+ - name : Restore Program Builds
183+ uses : actions/cache/restore@v4
184+ with :
185+ path : ./**/*.so
186+ key : ${{ runner.os }}-builds-${{ github.sha }}
187+
188+ - name : Benchmark Compute Units
189+ run : make bench-program-compute-units
190+
191+ - name : Check Working Directory
192+ run : |
193+ if [ -n "$(git status --porcelain)" ]; then
194+ test -z "$(git status --porcelain)"
195+ echo "CU usage has changed. Please run `cargo bench` and commit the new results.";
196+ exit 1;
197+ fi
198+
150199 generate_clients :
151200 name : Check Client Generation
152201 runs-on : ubuntu-latest
0 commit comments