6969
7070 - name : Lint / Features
7171 run : pnpm interface:lint:features
72+
73+ format_and_lint_program :
74+ name : Format & Lint Program
75+ runs-on : ubuntu-latest
76+ steps :
77+ - name : Git Checkout
78+ uses : actions/checkout@v4
79+
80+ - name : Setup Environment
81+ uses : ./.github/actions/setup
82+ with :
83+ toolchain : format, lint
84+
85+ - name : Format
86+ run : pnpm program:format
87+
88+ - name : Lint / Clippy
89+ run : pnpm program:lint:clippy
90+
91+ - name : Lint / Docs
92+ run : pnpm program:lint:docs
93+
94+ - name : Lint / Features
95+ run : pnpm program:lint:features
7296
7397 wasm_interface :
7498 name : Build Interface in WASM
@@ -130,10 +154,40 @@ jobs:
130154 git status --porcelain
131155 test -z "$(git status --porcelain)"
132156
157+ build_program :
158+ name : Build Program
159+ runs-on : ubuntu-latest
160+ needs : format_and_lint_program
161+ steps :
162+ - name : Git Checkout
163+ uses : actions/checkout@v4
164+
165+ - name : Setup Environment
166+ uses : ./.github/actions/setup
167+ with :
168+ cargo-cache-key : cargo-build-program
169+ solana : true
170+
171+ - name : Build
172+ run : pnpm program:build
173+
174+ - name : Upload Program Builds
175+ uses : actions/upload-artifact@v4
176+ with :
177+ name : program-builds
178+ path : ./target/deploy/*.so
179+ if-no-files-found : error
180+
181+ - name : Save Program Builds For Client Jobs
182+ uses : actions/cache/save@v4
183+ with :
184+ path : ./**/*.so
185+ key : ${{ runner.os }}-builds-${{ github.sha }}
186+
133187 test_client_js :
134188 name : Test Client JS
135189 runs-on : ubuntu-latest
136- needs : format_and_lint_client_js
190+ needs : [ format_and_lint_client_js, build_program]
137191 steps :
138192 - name : Git Checkout
139193 uses : actions/checkout@v4
@@ -143,13 +197,19 @@ jobs:
143197 with :
144198 solana : true
145199
200+ - name : Restore Program Builds
201+ uses : actions/cache/restore@v4
202+ with :
203+ path : ./**/*.so
204+ key : ${{ runner.os }}-builds-${{ github.sha }}
205+
146206 - name : Test Client JS
147207 run : pnpm js:test
148208
149209 test_client_rust :
150210 name : Test Client Rust
151211 runs-on : ubuntu-latest
152- needs : format_and_lint_client_rust
212+ needs : [ format_and_lint_client_rust, build_program]
153213 steps :
154214 - name : Git Checkout
155215 uses : actions/checkout@v4
@@ -161,5 +221,35 @@ jobs:
161221 toolchain : test
162222 solana : true
163223
224+ - name : Restore Program Builds
225+ uses : actions/cache/restore@v4
226+ with :
227+ path : ./**/*.so
228+ key : ${{ runner.os }}-builds-${{ github.sha }}
229+
164230 - name : Test Client Rust
165231 run : pnpm rust:test
232+
233+ test_program :
234+ name : Test Program
235+ runs-on : ubuntu-latest
236+ needs : build_program
237+ steps :
238+ - name : Git Checkout
239+ uses : actions/checkout@v4
240+
241+ - name : Setup Environment
242+ uses : ./.github/actions/setup
243+ with :
244+ cargo-cache-key : cargo-program-tests
245+ toolchain : test
246+ solana : true
247+
248+ - name : Restore Program Builds
249+ uses : actions/cache/restore@v4
250+ with :
251+ path : ./**/*.so
252+ key : ${{ runner.os }}-builds-${{ github.sha }}
253+
254+ - name : Test
255+ run : pnpm program:test
0 commit comments