Skip to content

Commit 8b1fc53

Browse files
committed
solana/CI: run cargo test
and don't attempt to run sbf tests when running `cargo test`
1 parent 2650cb7 commit 8b1fc53

File tree

5 files changed

+9
-11
lines changed

5 files changed

+9
-11
lines changed

.github/workflows/solana.yml

+4-11
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ jobs:
9191
sh -c "$(curl -sSfL https://release.solana.com/v${SOLANA_VERSION}/install)"
9292
~/.local/share/solana/install/active_release/bin/sdk/sbf/scripts/install.sh
9393
94-
- name: cargo build-sbf && cargo test-sbf
94+
- name: cargo build-sbf && cargo test-sbf && cargo test
9595
env:
9696
RUST_BACKTRACE: "1"
9797
run: |
@@ -101,16 +101,9 @@ jobs:
101101
102102
mkdir -p "${BPF_OUT_DIR}"
103103
104-
BPF_PACKAGES=(
105-
programs/example-native-token-transfers/Cargo.toml
106-
programs/wormhole-governance/Cargo.toml
107-
)
108-
for p in "${BPF_PACKAGES[@]}"; do
109-
cargo build-sbf --manifest-path "${p}"
110-
done
111-
for p in "${BPF_PACKAGES[@]}"; do
112-
cargo test-sbf --manifest-path "${p}"
113-
done
104+
cargo build-sbf
105+
cargo test-sbf
106+
cargo test
114107
anchor-test:
115108
name: Anchor Test
116109
runs-on: ubuntu-latest

solana/programs/example-native-token-transfers/Cargo.toml

+2
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,8 @@ idl-build = [
1818
"anchor-lang/idl-build",
1919
"anchor-spl/idl-build"
2020
]
21+
# cargo-test-sbf will pass this along
22+
test-sbf = []
2123

2224
[dependencies]
2325
ahash = "=0.8.5"

solana/programs/example-native-token-transfers/tests/cancel_flow.rs

+1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
#![cfg(feature = "test-sbf")]
12
#![feature(type_changing_struct_update)]
23

34
use anchor_lang::prelude::*;

solana/programs/example-native-token-transfers/tests/governance.rs

+1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
#![cfg(feature = "test-sbf")]
12
#![feature(type_changing_struct_update)]
23

34
use anchor_lang::{prelude::*, InstructionData};

solana/programs/example-native-token-transfers/tests/transfer.rs

+1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
#![cfg(feature = "test-sbf")]
12
#![feature(type_changing_struct_update)]
23

34
use anchor_lang::prelude::{Clock, Pubkey};

0 commit comments

Comments
 (0)