Skip to content

Commit

Permalink
svm: fix ci
Browse files Browse the repository at this point in the history
Signed-off-by: bingyuyap <[email protected]>
  • Loading branch information
bingyuyap committed Nov 25, 2024
1 parent 53a1d81 commit 454b559
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 18 deletions.
20 changes: 4 additions & 16 deletions .github/workflows/svm.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,38 +12,26 @@ jobs:
working-directory: svm
steps:
- uses: actions/checkout@v4

- name: Free Disk Space (Ubuntu)
run: |
df -h
sudo rm -rf /usr/share/dotnet
sudo rm -rf /usr/local/lib/android
sudo rm -rf /opt/ghc
sudo rm -rf /opt/hostedtoolcache/CodeQL
sudo docker image prune -af
df -h
working-directory: .

with:
submodules: 'recursive'
- name: Get solana version
id: solana
run: |
SOLANA_VERSION="$(awk '/solana_version =/ { print substr($3, 2, length($3)-2) }' Anchor.toml)"
echo "::set-output name=version::${SOLANA_VERSION}"
- name: Get anchor version
id: anchor
run: |
ANCHOR_VERSION="$(awk '/anchor_version =/ { print substr($3, 2, length($3)-2) }' Anchor.toml)"
echo "::set-output name=version::${ANCHOR_VERSION}"
- name: Build dependencies
run: make build
- uses: evan-gray/anchor-test@06370fbca011ee48b176211b8f858789d6c33282
with:
anchor-version: "${{steps.anchor.outputs.version}}"
solana-cli-version: "${{steps.solana.outputs.version}}"
working-directory: "svm"
features: "solana"

- run: cargo fmt --check --all
- run: cargo clippy
- run: cargo test-sbf
- run: cargo test
22 changes: 22 additions & 0 deletions svm/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
.PHONY: init build test

# Initialize and update submodules
init:
git submodule update --init --recursive

# Build the endpoint program
build-endpoint:
cd lib/example-messaging-endpoint/svm && anchor build

# Build everything
build: init build-endpoint
anchor build

# Run tests
test: build
anchor test

# Clean build artifacts
clean:
rm -rf target/
cd lib/example-messaging-endpoint/svm && rm -rf target/
2 changes: 0 additions & 2 deletions svm/programs/wormhole-guardian-adapter/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,6 @@ custom-heap = []
custom-panic = []
anchor-debug = []



[dependencies]
anchor-lang = { workspace = true, features = ["init-if-needed", "event-cpi"] }
cfg-if.workspace = true
Expand Down

0 comments on commit 454b559

Please sign in to comment.