Skip to content

Commit b38938e

Browse files
committed
CI: Add program and all extra steps
#### Problem The token program now lives in its program-specific repo, but no part of it is being exercised by CI. #### Summary of changes Integrate the token program properly into CI. This includes: * add it to the Cargo workspace, and removing spl-token-client, since it's currently empty * run lint / format / test on the program * run spellcheck / audit / semver checks on the Rust packages * move rust scripts to `scripts/rust` and make them reusable * update to Solana 2.1 and proper rust toolchains
1 parent 30521a1 commit b38938e

File tree

21 files changed

+2475
-2162
lines changed

21 files changed

+2475
-2162
lines changed

.github/workflows/main.yml

Lines changed: 96 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,85 @@ jobs:
4343
- name: Lint Client Rust
4444
run: pnpm clients:rust:lint
4545

46+
format_and_lint_program:
47+
name: Format & Lint Program
48+
runs-on: ubuntu-latest
49+
steps:
50+
- name: Git Checkout
51+
uses: actions/checkout@v4
52+
53+
- name: Setup Environment
54+
uses: ./.github/actions/setup
55+
with:
56+
clippy: true
57+
rustfmt: true
58+
59+
- name: Format
60+
run: pnpm programs:format
61+
62+
- name: Lint
63+
run: pnpm programs:lint
64+
65+
audit_rust:
66+
name: Audit Rust
67+
runs-on: ubuntu-latest
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-audit
76+
77+
- name: Install cargo-audit
78+
uses: taiki-e/install-action@v2
79+
with:
80+
tool: cargo-audit
81+
82+
- name: Run cargo-audit
83+
run: pnpm rust:audit
84+
85+
semver_rust:
86+
name: Check semver Rust
87+
runs-on: ubuntu-latest
88+
steps:
89+
- name: Git Checkout
90+
uses: actions/checkout@v4
91+
92+
- name: Setup Environment
93+
uses: ./.github/actions/setup
94+
with:
95+
cargo-cache-key: cargo-semver
96+
97+
- name: Install cargo-audit
98+
uses: taiki-e/install-action@v2
99+
with:
100+
tool: cargo-semver-checks
101+
102+
- name: Run semver checks
103+
run: pnpm rust:semver
104+
105+
spellcheck_rust:
106+
name: Spellcheck Rust
107+
runs-on: ubuntu-latest
108+
steps:
109+
- name: Git Checkout
110+
uses: actions/checkout@v4
111+
112+
- name: Setup Environment
113+
uses: ./.github/actions/setup
114+
with:
115+
cargo-cache-key: cargo-spellcheck
116+
117+
- name: Install cargo-spellcheck
118+
uses: taiki-e/install-action@v2
119+
with:
120+
tool: cargo-spellcheck
121+
122+
- name: Run cargo-spellcheck
123+
run: pnpm rust:spellcheck
124+
46125
generate_clients:
47126
name: Check Client Generation
48127
runs-on: ubuntu-latest
@@ -96,3 +175,20 @@ jobs:
96175

97176
- name: Test Client Rust
98177
run: pnpm clients:rust:test
178+
179+
test_program:
180+
name: Test Program
181+
runs-on: ubuntu-latest
182+
needs: format_and_lint_program
183+
steps:
184+
- name: Git Checkout
185+
uses: actions/checkout@v4
186+
187+
- name: Setup Environment
188+
uses: ./.github/actions/setup
189+
with:
190+
cargo-cache-key: cargo-rust-client
191+
solana: true
192+
193+
- name: Test
194+
run: pnpm programs:test

0 commit comments

Comments
 (0)