Skip to content

Commit 0914c6d

Browse files
authored
Merge branch 'solana-developers:main' into feat/litesvm-close-account
2 parents 9952124 + ce50ad4 commit 0914c6d

File tree

17 files changed

+641
-31
lines changed

17 files changed

+641
-31
lines changed

.github/workflows/rust.yml

Lines changed: 1 addition & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -10,34 +10,13 @@ on:
1010
branches:
1111
- main
1212
pull_request:
13-
types: [ opened, synchronize, reopened ]
13+
types: [opened, synchronize, reopened]
1414
branches:
1515
- main
1616

1717
# A workflow run is made up of one or more jobs, which run in parallel by default
1818
# Each job runs in a runner environment specified by runs-on
1919
jobs:
20-
# Unique identifier of our job (`job_id`)
21-
test:
22-
# Sets the name `Test` for the job, which is displayed in the GitHub UI
23-
name: Test
24-
# Containers must run in Linux based operating systems
25-
runs-on: ubuntu-latest
26-
steps:
27-
# Downloads a copy of the code in your repository before running CI tests
28-
- name: Check out repository code
29-
# The uses keyword specifies that this step will run v3 of the actions/checkout action.
30-
# This is an action that checks out your repository onto the runner, allowing you to run scripts or other actions against your code (such as build and test tools).
31-
# You should use the checkout action any time your workflow will run against the repository's code.
32-
uses: actions/checkout@v4
33-
34-
# This GitHub Action installs a Rust toolchain using rustup. It is designed for one-line concise usage and good defaults.
35-
- name: Install the Rust toolchain
36-
uses: dtolnay/rust-toolchain@stable
37-
38-
- name: Run tests
39-
run: cargo test
40-
4120
# `fmt` container job
4221
fmt:
4322
name: Rustfmt

.github/workflows/solana-native.yml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -143,6 +143,17 @@ jobs:
143143
return 1
144144
fi
145145
146+
# Run Rust unit tests
147+
if [ -d "program" ]; then
148+
echo "Running Rust unit tests for $project"
149+
if ! cargo test --manifest-path=./program/Cargo.toml; then
150+
echo "::error::Rust unit tests failed for $project"
151+
echo "$project: Rust unit tests failed with $solana_version" >> $GITHUB_WORKSPACE/failed_projects.txt
152+
cd - > /dev/null
153+
return 1
154+
fi
155+
fi
156+
146157
echo "Build and tests succeeded for $project with $solana_version version."
147158
cd - > /dev/null
148159
return 0

Cargo.lock

Lines changed: 155 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

basics/account-data/native/program/tests/tests.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,7 @@ fn test_account_data() {
1919

2020
svm.airdrop(&payer.pubkey(), LAMPORTS_PER_SOL * 10).unwrap();
2121

22-
let program_bytes =
23-
include_bytes!("../../../../../target/deploy/account_data_native_program.so");
22+
let program_bytes = include_bytes!("../../tests/fixtures/account_data_native_program.so");
2423

2524
svm.add_program(program_id, program_bytes).unwrap();
2625

basics/checking-accounts/native/program/Cargo.toml

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,17 @@ solana-system-interface.workspace = true
1111
crate-type = ["cdylib", "lib"]
1212

1313
[features]
14-
anchor-debug = []
1514
custom-heap = []
1615
custom-panic = []
1716

1817

1918
[lints.rust]
2019
unexpected_cfgs = { level = "warn", check-cfg = ['cfg(target_os, values("solana"))'] }
20+
21+
[dev-dependencies]
22+
litesvm = "0.8.1"
23+
solana-keypair = "3.0.1"
24+
solana-native-token = "3.0.0"
25+
solana-pubkey = "3.0.0"
26+
solana-sdk = "3.0.0"
27+
solana-transaction = "3.0.1"

0 commit comments

Comments
 (0)