Skip to content

Commit 526ec64

Browse files
authored
Bump Rust, Codama, and add program to CI (#42)
* Bump Rust version and Codama renderer #### Problem The memo program implementation uses the v2.1 Solana crates and toolchain, but the client doesn't. #### Summary of changes Add rust-toolchain.toml, update the toolchain versions, update the Solana crate versions, and the rust renderer. Lots of changes, but almost none of them manual! * Add program to build * Update "needs:" directives * Update scripts
1 parent a8daeb2 commit 526ec64

File tree

13 files changed

+2259
-1394
lines changed

13 files changed

+2259
-1394
lines changed

.github/workflows/main.yml

Lines changed: 82 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,25 @@ on:
77
branches: [main]
88

99
jobs:
10+
format_and_lint_programs:
11+
name: Format & Lint Programs
12+
runs-on: ubuntu-latest
13+
steps:
14+
- name: Git Checkout
15+
uses: actions/checkout@v4
16+
17+
- name: Setup Environment
18+
uses: ./.github/actions/setup
19+
with:
20+
clippy: true
21+
rustfmt: true
22+
23+
- name: Format Programs
24+
run: pnpm programs:format
25+
26+
- name: Lint Programs
27+
run: pnpm programs:lint
28+
1029
format_and_lint_client_js:
1130
name: Format & Lint Client JS
1231
runs-on: ubuntu-latest
@@ -42,9 +61,58 @@ jobs:
4261
- name: Lint Client Rust
4362
run: pnpm clients:rust:lint
4463

64+
build_programs:
65+
name: Build programs
66+
runs-on: ubuntu-latest
67+
needs: format_and_lint_programs
68+
steps:
69+
- name: Git Checkout
70+
uses: actions/checkout@v4
71+
72+
- name: Setup Environment
73+
uses: ./.github/actions/setup
74+
with:
75+
cargo-cache-key: cargo-programs
76+
solana: true
77+
78+
- name: Build Programs
79+
run: pnpm programs:build
80+
81+
- name: Upload Program Builds
82+
uses: actions/upload-artifact@v4
83+
with:
84+
name: program-builds
85+
path: ./target/deploy/*.so
86+
if-no-files-found: error
87+
88+
- name: Save Program Builds For Client Jobs
89+
uses: actions/cache/save@v4
90+
with:
91+
path: ./**/*.so
92+
key: ${{ runner.os }}-builds-${{ github.sha }}
93+
94+
test_programs:
95+
name: Test Programs
96+
runs-on: ubuntu-latest
97+
needs: format_and_lint_programs
98+
steps:
99+
- name: Git Checkout
100+
uses: actions/checkout@v4
101+
102+
- name: Setup Environment
103+
uses: ./.github/actions/setup
104+
with:
105+
cargo-cache-key: cargo-program-tests
106+
cargo-cache-fallback-key: cargo-programs
107+
solana: true
108+
109+
- name: Test Programs
110+
run: pnpm programs:test
111+
45112
generate_clients:
46113
name: Check Client Generation
47114
runs-on: ubuntu-latest
115+
needs: format_and_lint_programs
48116
steps:
49117
- name: Git Checkout
50118
uses: actions/checkout@v4
@@ -65,7 +133,7 @@ jobs:
65133
test_client_js:
66134
name: Test Client JS
67135
runs-on: ubuntu-latest
68-
needs: format_and_lint_client_js
136+
needs: build_programs
69137
steps:
70138
- name: Git Checkout
71139
uses: actions/checkout@v4
@@ -75,13 +143,19 @@ jobs:
75143
with:
76144
solana: true
77145

146+
- name: Restore Program Builds
147+
uses: actions/cache/restore@v4
148+
with:
149+
path: ./**/*.so
150+
key: ${{ runner.os }}-builds-${{ github.sha }}
151+
78152
- name: Test Client JS
79153
run: pnpm clients:js:test
80154

81155
test_client_rust:
82156
name: Test Client Rust
83157
runs-on: ubuntu-latest
84-
needs: format_and_lint_client_rust
158+
needs: build_programs
85159
steps:
86160
- name: Git Checkout
87161
uses: actions/checkout@v4
@@ -92,5 +166,11 @@ jobs:
92166
cargo-cache-key: cargo-rust-client
93167
solana: true
94168

169+
- name: Restore Program Builds
170+
uses: actions/cache/restore@v4
171+
with:
172+
path: ./**/*.so
173+
key: ${{ runner.os }}-builds-${{ github.sha }}
174+
95175
- name: Test Client Rust
96176
run: pnpm clients:rust:test

0 commit comments

Comments
 (0)