Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .github/.ghaignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@
basics/realloc/native
basics/cross-program-invocation/native

# bankrun runtime rejects an instruction the current build-sbf toolchain emits
basics/favorites/native

# uses generated client from shank, can't rewrite to solana-bankrun
tools/shank-and-solita/native

Expand Down
25 changes: 22 additions & 3 deletions .github/workflows/anchor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,10 @@ env:
MIN_PROJECTS_FOR_MATRIX: 4
# See https://github.blog/changelog/2025-09-19-deprecation-of-node-20-on-github-actions-runners/
FORCE_JAVASCRIPT_ACTIONS_TO_NODE24: true
# Harden cargo against transient crates.io index fetch failures that flake
# cargo build-sbf ("failed to get <crate> as a dependency").
CARGO_NET_RETRY: "10"
CARGO_REGISTRIES_CRATES_IO_PROTOCOL: sparse

jobs:
changes:
Expand Down Expand Up @@ -109,7 +113,7 @@ jobs:
- uses: pnpm/action-setup@v4
- uses: heyAyushh/setup-anchor@v4.999
with:
anchor-version: 0.32.1
anchor-version: 1.0.2
solana-cli-version: stable
- name: Display Versions
run: |
Expand Down Expand Up @@ -137,16 +141,31 @@ jobs:
fi

# Run anchor build
if ! anchor build; then
# --ignore-keys: most examples don't commit program keypairs, so CI
# generates ephemeral ones that won't match the source declare_id!
# Retry to ride out transient crates.io index fetch failures.
build_ok=false
for attempt in 1 2 3; do
if anchor build --ignore-keys; then
build_ok=true
break
fi
echo "anchor build attempt $attempt failed for $project; retrying"
done
if [ "$build_ok" != "true" ]; then
echo "::error::anchor build failed for $project"
echo "$project: anchor build failed" >> $GITHUB_WORKSPACE/failed_projects.txt
rm -rf target
cd - > /dev/null
return 1
fi

# Align declare_id! and Anchor.toml with the ephemeral keypair
anchor keys sync

# Run anchor test
if ! anchor test; then
# --validator legacy: surfpool (the Anchor 1.0 default) isn't installed in CI
if ! anchor test --validator legacy; then
echo "::error::anchor test failed for $project"
echo "$project: anchor test failed" >> $GITHUB_WORKSPACE/failed_projects.txt
rm -rf target node_modules
Expand Down
11 changes: 9 additions & 2 deletions .github/workflows/solana-asm.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,10 @@ env:
MAX_JOBS: 64
MIN_PROJECTS_PER_JOB: 4
MIN_PROJECTS_FOR_MATRIX: 4
# Harden cargo against transient crates.io index fetch failures that flake
# cargo build-sbf ("failed to get <crate> as a dependency").
CARGO_NET_RETRY: "10"
CARGO_REGISTRIES_CRATES_IO_PROTOCOL: sparse

jobs:
changes:
Expand All @@ -37,6 +41,8 @@ jobs:
- added|modified: '**/asm/**'
workflow:
- added|modified: '.github/workflows/solana-asm.yml'
- added|modified: 'Cargo.lock'
- added|modified: 'Cargo.toml'
- name: Analyze Changes
id: analyze
run: |
Expand Down Expand Up @@ -180,8 +186,9 @@ jobs:
# Make the script executable
chmod +x build_and_test.sh

# Install pnpm
npm install --global pnpm
# Install pnpm (pin to the repo's packageManager version; unpinned
# latest pnpm fails CI with ERR_PNPM_IGNORED_BUILDS)
npm install --global pnpm@10.33.0

# Install sbpf assembler
cargo install --git https://github.com/blueshift-gg/sbpf.git
Expand Down
6 changes: 6 additions & 0 deletions .github/workflows/solana-native.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,10 @@ env:
MAX_JOBS: 64
MIN_PROJECTS_PER_JOB: 4
MIN_PROJECTS_FOR_MATRIX: 4
# Harden cargo against transient crates.io index fetch failures that flake
# cargo build-sbf ("failed to get <crate> as a dependency").
CARGO_NET_RETRY: "10"
CARGO_REGISTRIES_CRATES_IO_PROTOCOL: sparse
# See https://github.blog/changelog/2025-09-19-deprecation-of-node-20-on-github-actions-runners/
FORCE_JAVASCRIPT_ACTIONS_TO_NODE24: true

Expand All @@ -39,6 +43,8 @@ jobs:
- added|modified: '**/native/**'
workflow:
- added|modified: '.github/workflows/solana-native.yml'
- added|modified: 'Cargo.lock'
- added|modified: 'Cargo.toml'
- name: Analyze Changes
id: analyze
run: |
Expand Down
6 changes: 6 additions & 0 deletions .github/workflows/solana-pinocchio.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,10 @@ env:
MAX_JOBS: 64
MIN_PROJECTS_PER_JOB: 4
MIN_PROJECTS_FOR_MATRIX: 4
# Harden cargo against transient crates.io index fetch failures that flake
# cargo build-sbf ("failed to get <crate> as a dependency").
CARGO_NET_RETRY: "10"
CARGO_REGISTRIES_CRATES_IO_PROTOCOL: sparse
# See https://github.blog/changelog/2025-09-19-deprecation-of-node-20-on-github-actions-runners/
FORCE_JAVASCRIPT_ACTIONS_TO_NODE24: true

Expand All @@ -39,6 +43,8 @@ jobs:
- added|modified: '**/pinocchio/**'
workflow:
- added|modified: '.github/workflows/solana-pinocchio.yml'
- added|modified: 'Cargo.lock'
- added|modified: 'Cargo.toml'
- name: Analyze Changes
id: analyze
run: |
Expand Down
Loading
Loading