Skip to content

Commit cba08da

Browse files
authored
Merge branch 'main' into claude/perpetual-futures-solana-PqgNj
2 parents 787a182 + 0d1c060 commit cba08da

1,216 files changed

Lines changed: 42248 additions & 83138 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/.ghaignore

Lines changed: 0 additions & 73 deletions
Original file line numberDiff line numberDiff line change
@@ -1,73 +0,0 @@
1-
# build and test error
2-
basics/realloc/native
3-
basics/cross-program-invocation/native
4-
5-
# uses generated client from shank, can't rewrite to solana-bankrun
6-
tools/shank-and-solita/native
7-
8-
# can't test on localnet
9-
tokens/pda-mint-authority/native
10-
tokens/nft-minter/native
11-
tokens/transfer-tokens/native
12-
tokens/token-minter/native
13-
tokens/create-token/native
14-
15-
finance/token-swap/anchor
16-
17-
# not building
18-
basics/pyth/anchor
19-
20-
# not building
21-
compression/cutils/anchor
22-
compression/cnft-vault/anchor
23-
# builds but need to test on localhost
24-
compression/cnft-burn/anchor
25-
26-
# test failing
27-
# https://github.com/solana-developers/helpers/issues/40
28-
finance/escrow/anchor
29-
30-
# not live
31-
tokens/token-extensions/group/anchor
32-
tokens/token-extensions/group/quasar
33-
34-
# CPI quasar project uses subdirectories (hand/ and lever/) instead of a root Quasar.toml
35-
basics/cross-program-invocation/quasar
36-
37-
38-
39-
# error in tests
40-
tokens/external-delegate-token-master/anchor
41-
42-
# build failed - program outdated
43-
tokens/token-extensions/metadata/anchor
44-
45-
# dependency issues
46-
tokens/token-extensions/nft-meta-data-pointer/anchor-example/anchor
47-
48-
tokens/token-extensions/mint-close-authority/native
49-
tokens/token-extensions/transfer-fee/native
50-
tokens/token-extensions/non-transferable/native
51-
52-
# all steel projects
53-
54-
basics/account-data/steel
55-
basics/checking-accounts/steel
56-
basics/close-account/steel
57-
basics/counter/steel
58-
basics/create-account/steel
59-
basics/cross-program-invocation/steel
60-
basics/favorites/steel
61-
basics/pda-rent-payer/steel
62-
basics/processing-instructions/steel
63-
basics/program-derived-addresses/steel
64-
basics/realloc/steel
65-
basics/rent/steel
66-
basics/transfer-sol/steel
67-
68-
finance/escrow/steel
69-
70-
tokens/pda-mint-authority/steel
71-
tokens/token-minter/steel
72-
finance/token-swap/steel
73-
tokens/transfer-tokens/steel

.github/workflows/native.yml

Lines changed: 37 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,14 @@ jobs:
5555
# that by construction — no substring matching, no path-segment trickery,
5656
# so siblings like "alternative/" can never enter the build list.
5757
function get_projects() {
58-
find . -type d -name "native" | grep -vE "$ignore_pattern" | sort
58+
# An empty .ghaignore makes ignore_pattern empty, and `grep -vE ""`
59+
# matches everything, silently emptying the project list - only
60+
# filter when there is actually a pattern.
61+
if [[ -n "$ignore_pattern" ]]; then
62+
find . -type d -name "native" | grep -vE "$ignore_pattern" | sort
63+
else
64+
find . -type d -name "native" | sort
65+
fi
5966
}
6067
6168
# Filter the full project list down to projects touched by the given
@@ -158,12 +165,6 @@ jobs:
158165
key: cargo-${{ runner.os }}-${{ hashFiles('**/Cargo.toml', '**/Cargo.lock') }}
159166
restore-keys: |
160167
cargo-${{ runner.os }}-
161-
- uses: pnpm/action-setup@v4
162-
- name: Use Node.js
163-
uses: actions/setup-node@v5
164-
with:
165-
node-version: 'lts/*'
166-
check-latest: true
167168
- name: Setup build environment
168169
id: setup
169170
run: |
@@ -175,40 +176,45 @@ jobs:
175176
echo "Building and Testing $project with Solana $solana_version"
176177
cd "$project" || return 1
177178
178-
# Install dependencies
179-
if ! pnpm install --frozen-lockfile; then
180-
echo "::error::pnpm install failed for $project"
181-
echo "$project: pnpm install failed with $solana_version" >> $GITHUB_WORKSPACE/failed_projects.txt
182-
cd - > /dev/null
183-
return 1
179+
# Collect program manifests: single-program projects use program/,
180+
# multi-program projects (e.g. cross-program-invocation) use programs/*/.
181+
local manifests=()
182+
if [ -d "program" ]; then
183+
manifests=("./program/Cargo.toml")
184+
elif [ -d "programs" ]; then
185+
for manifest in programs/*/Cargo.toml; do
186+
manifests+=("./$manifest")
187+
done
184188
fi
185189
186-
# Build
187-
if ! pnpm build; then
188-
echo "::error::build failed for $project"
189-
echo "$project: build failed with $solana_version" >> $GITHUB_WORKSPACE/failed_projects.txt
190+
if [ ${#manifests[@]} -eq 0 ]; then
191+
echo "::error::no program manifest found for $project"
192+
echo "$project: no program manifest found with $solana_version" >> $GITHUB_WORKSPACE/failed_projects.txt
190193
cd - > /dev/null
191194
return 1
192195
fi
193196
194-
# Test
195-
if ! pnpm build-and-test; then
196-
echo "::error::tests failed for $project"
197-
echo "$project: tests failed with $solana_version" >> $GITHUB_WORKSPACE/failed_projects.txt
198-
cd - > /dev/null
199-
return 1
200-
fi
197+
# Build the .so files first: the Rust + LiteSVM tests embed them
198+
# at compile time via include_bytes!, so the tests cannot even
199+
# compile without a build, and a stale .so would test old code.
200+
for manifest in "${manifests[@]}"; do
201+
if ! cargo build-sbf --manifest-path="$manifest"; then
202+
echo "::error::build failed for $project ($manifest)"
203+
echo "$project: build failed with $solana_version" >> $GITHUB_WORKSPACE/failed_projects.txt
204+
cd - > /dev/null
205+
return 1
206+
fi
207+
done
201208
202-
# Run Rust unit tests
203-
if [ -d "program" ]; then
204-
echo "Running Rust unit tests for $project"
205-
if ! cargo test --manifest-path=./program/Cargo.toml; then
206-
echo "::error::Rust unit tests failed for $project"
207-
echo "$project: Rust unit tests failed with $solana_version" >> $GITHUB_WORKSPACE/failed_projects.txt
209+
# Run the Rust + LiteSVM tests
210+
for manifest in "${manifests[@]}"; do
211+
if ! cargo test --manifest-path="$manifest"; then
212+
echo "::error::tests failed for $project ($manifest)"
213+
echo "$project: tests failed with $solana_version" >> $GITHUB_WORKSPACE/failed_projects.txt
208214
cd - > /dev/null
209215
return 1
210216
fi
211-
fi
217+
done
212218
213219
echo "Build and tests succeeded for $project with $solana_version version."
214220
cd - > /dev/null

.github/workflows/pinocchio.yml

Lines changed: 37 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,14 @@ jobs:
5656
# trickery, so siblings like "pinocchio-example/" can never enter the
5757
# build list.
5858
function get_projects() {
59-
find . -type d -name "pinocchio" | grep -vE "$ignore_pattern" | sort
59+
# An empty .ghaignore makes ignore_pattern empty, and `grep -vE ""`
60+
# matches everything, silently emptying the project list - only
61+
# filter when there is actually a pattern.
62+
if [[ -n "$ignore_pattern" ]]; then
63+
find . -type d -name "pinocchio" | grep -vE "$ignore_pattern" | sort
64+
else
65+
find . -type d -name "pinocchio" | sort
66+
fi
6067
}
6168
6269
# Filter the full project list down to projects touched by the given
@@ -159,12 +166,6 @@ jobs:
159166
key: cargo-${{ runner.os }}-${{ hashFiles('**/Cargo.toml', '**/Cargo.lock') }}
160167
restore-keys: |
161168
cargo-${{ runner.os }}-
162-
- uses: pnpm/action-setup@v4
163-
- name: Use Node.js
164-
uses: actions/setup-node@v5
165-
with:
166-
node-version: "lts/*"
167-
check-latest: true
168169
- name: Setup build environment
169170
id: setup
170171
run: |
@@ -176,40 +177,45 @@ jobs:
176177
echo "Building and Testing $project with Solana $solana_version"
177178
cd "$project" || return 1
178179
179-
# Install dependencies
180-
if ! pnpm install --frozen-lockfile; then
181-
echo "::error::pnpm install failed for $project"
182-
echo "$project: pnpm install failed with $solana_version" >> $GITHUB_WORKSPACE/failed_projects.txt
183-
cd - > /dev/null
184-
return 1
180+
# Collect program manifests: single-program projects use program/,
181+
# multi-program projects (e.g. cross-program-invocation) use programs/*/.
182+
local manifests=()
183+
if [ -d "program" ]; then
184+
manifests=("./program/Cargo.toml")
185+
elif [ -d "programs" ]; then
186+
for manifest in programs/*/Cargo.toml; do
187+
manifests+=("./$manifest")
188+
done
185189
fi
186190
187-
# Build
188-
if ! pnpm build; then
189-
echo "::error::build failed for $project"
190-
echo "$project: build failed with $solana_version" >> $GITHUB_WORKSPACE/failed_projects.txt
191+
if [ ${#manifests[@]} -eq 0 ]; then
192+
echo "::error::no program manifest found for $project"
193+
echo "$project: no program manifest found with $solana_version" >> $GITHUB_WORKSPACE/failed_projects.txt
191194
cd - > /dev/null
192195
return 1
193196
fi
194197
195-
# Test
196-
if ! pnpm build-and-test; then
197-
echo "::error::tests failed for $project"
198-
echo "$project: tests failed with $solana_version" >> $GITHUB_WORKSPACE/failed_projects.txt
199-
cd - > /dev/null
200-
return 1
201-
fi
198+
# Build the .so files first: the Rust + LiteSVM tests embed them
199+
# at compile time via include_bytes!, so the tests cannot even
200+
# compile without a build, and a stale .so would test old code.
201+
for manifest in "${manifests[@]}"; do
202+
if ! cargo build-sbf --manifest-path="$manifest"; then
203+
echo "::error::build failed for $project ($manifest)"
204+
echo "$project: build failed with $solana_version" >> $GITHUB_WORKSPACE/failed_projects.txt
205+
cd - > /dev/null
206+
return 1
207+
fi
208+
done
202209
203-
# Run Rust unit tests
204-
if [ -d "program" ]; then
205-
echo "Running Rust unit tests for $project"
206-
if ! cargo test --manifest-path=./program/Cargo.toml; then
207-
echo "::error::Rust unit tests failed for $project"
208-
echo "$project: Rust unit tests failed with $solana_version" >> $GITHUB_WORKSPACE/failed_projects.txt
210+
# Run the Rust + LiteSVM tests
211+
for manifest in "${manifests[@]}"; do
212+
if ! cargo test --manifest-path="$manifest"; then
213+
echo "::error::tests failed for $project ($manifest)"
214+
echo "$project: tests failed with $solana_version" >> $GITHUB_WORKSPACE/failed_projects.txt
209215
cd - > /dev/null
210216
return 1
211217
fi
212-
fi
218+
done
213219
214220
echo "Build and tests succeeded for $project with $solana_version version."
215221
cd - > /dev/null

.github/workflows/quasar.yml

Lines changed: 37 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -171,22 +171,49 @@ jobs:
171171
echo "Building and Testing $project with Solana $solana_version"
172172
cd "$project" || return 1
173173
174-
# Build with quasar CLI
175-
if ! quasar build; then
176-
echo "::error::quasar build failed for $project"
177-
echo "$project: quasar build failed with $solana_version" >> $GITHUB_WORKSPACE/failed_projects.txt
178-
cd - > /dev/null
179-
return 1
174+
# Determine the quasar program directories for this project. Normally
175+
# the project dir itself holds the Quasar.toml. Some examples (e.g. the
176+
# cross-program-invocation CPI demo) instead contain several program
177+
# subdirectories (hand/, lever/), each its own Quasar project. In that
178+
# case build them all *first*, then test them all, so a program whose
179+
# tests load a sibling program's compiled .so (the CPI callee) has it
180+
# available regardless of directory order.
181+
local prog_dirs=()
182+
if [ -f Quasar.toml ]; then
183+
prog_dirs=(".")
184+
else
185+
for d in */; do
186+
[ -f "${d}Quasar.toml" ] && prog_dirs+=("${d%/}")
187+
done
180188
fi
181189
182-
# Run Rust tests (quasar examples use cargo test with quasar-svm)
183-
if ! cargo test; then
184-
echo "::error::cargo test failed for $project"
185-
echo "$project: cargo test failed with $solana_version" >> $GITHUB_WORKSPACE/failed_projects.txt
190+
if [ ${#prog_dirs[@]} -eq 0 ]; then
191+
echo "::error::no Quasar.toml found for $project"
192+
echo "$project: no Quasar.toml found with $solana_version" >> $GITHUB_WORKSPACE/failed_projects.txt
186193
cd - > /dev/null
187194
return 1
188195
fi
189196
197+
# Build every program first.
198+
for d in "${prog_dirs[@]}"; do
199+
if ! ( cd "$d" && quasar build ); then
200+
echo "::error::quasar build failed for $project ($d)"
201+
echo "$project: quasar build failed with $solana_version" >> $GITHUB_WORKSPACE/failed_projects.txt
202+
cd - > /dev/null
203+
return 1
204+
fi
205+
done
206+
207+
# Then run Rust tests (quasar examples use cargo test with quasar-svm).
208+
for d in "${prog_dirs[@]}"; do
209+
if ! ( cd "$d" && cargo test ); then
210+
echo "::error::cargo test failed for $project ($d)"
211+
echo "$project: cargo test failed with $solana_version" >> $GITHUB_WORKSPACE/failed_projects.txt
212+
cd - > /dev/null
213+
return 1
214+
fi
215+
done
216+
190217
echo "Build and tests succeeded for $project with $solana_version version."
191218
cd - > /dev/null
192219
return 0

0 commit comments

Comments
 (0)