Skip to content
Merged
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
35 changes: 33 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,37 @@ jobs:
- name: 'Run unit tests'
run: cargo test --locked --workspace --exclude basic_solana --exclude sol_rpc_int_tests --exclude sol_rpc_e2e_tests

icp-ninja-tests:
runs-on: ubuntu-latest
steps:
- name: 'Checkout'
uses: actions/checkout@v4

- name: 'Install dfx'
uses: dfinity/setup-dfx@e50c04f104ee4285ec010f10609483cf41e4d365
with:
dfx-version: "0.27.0"

- name: 'Confirm dfx successful installation'
run: dfx --version

- name: 'Use free Solana RPC provider'
working-directory: examples/basic_solana/ninja
run: |
sed -i 's|solana_network = opt variant { Devnet }|solana_network = opt variant { Custom = record { url = \\"https://api.devnet.solana.com\\"; headers = null } }|g' dfx.json

- name: "Deploy locally"
working-directory: examples/basic_solana/ninja
run: |
dfx start --clean --background
dfx deploy
out=$(dfx canister call basic_solana solana_account --output json)
echo "$out"
echo "$out" | grep -Eq "[1-9A-HJ-NP-Za-km-z]{32,44}" || { echo "❌ Call to 'solana_account' failed"; exit 1; }
out=$(dfx canister call basic_solana get_balance --output json)
echo "$out"
echo "$out" | grep -Eq "[0-9]+(_[0-9]+)*" || { echo "❌ Call to 'get_balance' failed"; exit 1; }

integration-tests:
needs: [ reproducible-build ]
runs-on: ubuntu-22.04
Expand Down Expand Up @@ -213,10 +244,10 @@ jobs:
dfx deploy
out=$(dfx canister call basic_solana solana_account --output json)
echo "$out"
echo "$out" | grep -E "[1-9A-HJ-NP-Za-km-z]{32,44}" > /dev/null || { echo "❌ Call to 'solana_account' failed"; exit 1; }
echo "$out" | grep -Eq "[1-9A-HJ-NP-Za-km-z]{32,44}" || { echo "❌ Call to 'solana_account' failed"; exit 1; }
out=$(dfx canister call basic_solana get_balance --output json)
echo "$out"
echo "$out" | grep -E "[0-9]+(?:_[0-9]+)*" > /dev/null || { echo "❌ Call to 'get_balance' failed"; exit 1; }
echo "$out" | grep -Eq "[0-9]+(_[0-9]+)*" || { echo "❌ Call to 'get_balance' failed"; exit 1; }

- name: "Deploy SOL RPC Canister"
run: |
Expand Down