Skip to content

Commit

Permalink
Add SBPFv1 to the CI pipeline
Browse files Browse the repository at this point in the history
  • Loading branch information
LucasSte committed Mar 3, 2025
1 parent 2ded03e commit 15194ef
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 3 deletions.
6 changes: 5 additions & 1 deletion ci/test-stable.sh
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ test-stable-sbf)
# Install the platform tools
_ platform-tools-sdk/sbf/scripts/install.sh

# SBF program tests
# SBPFv0 program tests
_ make -C programs/sbf test-v0

# SBF program instruction count assertion
Expand All @@ -68,6 +68,10 @@ test-stable-sbf)
sbf_dump_archive="sbf-dumps.tar.bz2"
rm -f "$sbf_dump_archive"
tar cjvf "$sbf_dump_archive" $sbf_target_path/deploy/{*.txt,*.so}

# SBPFv1 program tests
_ make -C programs/sbf clean-all test-v1

exit 0
;;
test-docs)
Expand Down
18 changes: 16 additions & 2 deletions programs/sbf/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,27 @@ SBF_SDK_PATH := ../../platform-tools-sdk/sbf
SRC_DIR := c/src
OUT_DIR := target/deploy

test-v0: all rust-v0
clean-all: clean
cargo clean

test:
SBF_OUT_DIR=$(OUT_DIR) cargo test --features="sbf_rust,sbf_c" $(TEST_ARGS)

test-v1:
SBPF_CPU=v1 $(MAKE) all ; \
$(MAKE) rust-v1 ; \
$(MAKE) test

test-v0: all rust-v0 test

rust-v0:
cargo +solana build --release --target sbpf-solana-solana --workspace ; \
cp -r target/sbpf-solana-solana/release/* target/deploy

.PHONY: rust
rust-v1:
cargo +solana build --release --target sbpfv1-solana-solana --workspace ; \
cp -r target/sbpfv1-solana-solana/release/* target/deploy

.PHONY: rust-v0

include $(SBF_SDK_PATH)/c/sbf.mk

0 comments on commit 15194ef

Please sign in to comment.