Skip to content
Draft
Show file tree
Hide file tree
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
55 changes: 55 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ on:
branches:
- main
pull_request:
workflow_dispatch:

env:
CARGO_TERM_COLOR: always
Expand Down Expand Up @@ -130,3 +131,57 @@ jobs:
- name: Test
working-directory: solana
run: just test

solana-bridge-tests:
name: Solana Bridge Tests
runs-on: ubuntu-latest
timeout-minutes: 25
strategy:
fail-fast: false
matrix:
test:
- name: solana_listener_catchup
localosmosis: false
- name: bridge_transfer
localosmosis: true
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Install dependencies
uses: awalsh128/cache-apt-pkgs-action@v1
with:
packages: libudev-dev libusb-1.0-0-dev libhidapi-dev mold
- uses: taiki-e/install-action@v2
with:
tool: [email protected]
- name: Rust cache
uses: Swatinem/rust-cache@v2
with:
prefix-key: "v1-solana-bridge-tests"
cache-workspace-crates: true
# https://github.com/Swatinem/rust-cache/issues/237
cache-bin: false
workspaces: |
.
- name: Cache solana binaries
uses: actions/cache@v4
id: solana-cache
with:
key: solana-${{ hashFiles('solana/justfile') }}
restore-keys: |
solana
path: |
~/.cargo/bin
- name: Setup solana
if: steps.solana-cache.outputs.cache-hit == 'false' || steps.solana-cache.outputs.cache-hit == ''
working-directory: solana
run: just download-solana
- name: Start localosmosis
if: ${{ matrix.test.localosmosis }}
run: just localosmosis
- name: Start solana-test-validator
working-directory: solana
run: just solana-test-validator
- name: Run ${{ matrix.test.name }} test
working-directory: packages/integration-tests
run: RUST_LOG=info,kolme=debug,six_sigma=debug cargo t ${{ matrix.test.name }} -- --ignored --nocapture
13 changes: 3 additions & 10 deletions packages/integration-tests/solana-bridge-tests.sh
Original file line number Diff line number Diff line change
@@ -1,14 +1,7 @@
#!/usr/bin/env bash
set -euo pipefail

nohup solana-test-validator > /dev/null &
SOL_VALIDATOR_PID=$!

echo "Waiting for solana-test-validator to start"
sleep 5
(cd ../../solana; just solana-test-validator)
trap 'rm -rf test-ledger/; echo; echo "Shutting down solana-test-validator"; killall solana-test-validator' EXIT

RUST_LOG=info,kolme=debug,six_sigma=debug cargo t $1 -- --ignored --nocapture

echo "Shutting down solana-test-validator"
kill $SOL_VALIDATOR_PID

rm -rf test-ledger/
5 changes: 5 additions & 0 deletions solana/justfile
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,11 @@ download-solana:
rm solana-release.tar.bz2
rm -rf solana-release

solana-test-validator:
nohup solana-test-validator > /dev/null &
@printf "Waiting for solana-test-validator to start..."
@while ! curl -s http://localhost:8899 > /dev/null; do sleep 1; printf .; done; sleep 1; echo

# Cargo inherit
inherit:
cargo autoinherit
Loading