Skip to content

Commit b9df476

Browse files
committed
KOL-81 Ensure the Solana tests are run in CI
1 parent bd67c78 commit b9df476

File tree

3 files changed

+63
-10
lines changed

3 files changed

+63
-10
lines changed

.github/workflows/ci.yml

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ on:
55
branches:
66
- main
77
pull_request:
8+
workflow_dispatch:
89

910
env:
1011
CARGO_TERM_COLOR: always
@@ -130,3 +131,57 @@ jobs:
130131
- name: Test
131132
working-directory: solana
132133
run: just test
134+
135+
solana-bridge-tests:
136+
name: Solana Bridge Tests
137+
runs-on: ubuntu-latest
138+
timeout-minutes: 25
139+
strategy:
140+
fail-fast: false
141+
matrix:
142+
test:
143+
- name: solana_listener_catchup
144+
localosmosis: false
145+
- name: bridge_transfer
146+
localosmosis: true
147+
steps:
148+
- name: Checkout
149+
uses: actions/checkout@v4
150+
- name: Install dependencies
151+
uses: awalsh128/cache-apt-pkgs-action@v1
152+
with:
153+
packages: libudev-dev libusb-1.0-0-dev libhidapi-dev mold
154+
- uses: taiki-e/install-action@v2
155+
with:
156+
157+
- name: Rust cache
158+
uses: Swatinem/rust-cache@v2
159+
with:
160+
prefix-key: "v1-solana-bridge-tests"
161+
cache-workspace-crates: true
162+
# https://github.com/Swatinem/rust-cache/issues/237
163+
cache-bin: false
164+
workspaces: |
165+
.
166+
- name: Cache solana binaries
167+
uses: actions/cache@v4
168+
id: solana-cache
169+
with:
170+
key: solana-${{ hashFiles('solana/justfile') }}
171+
restore-keys: |
172+
solana
173+
path: |
174+
~/.cargo/bin
175+
- name: Setup solana
176+
if: steps.solana-cache.outputs.cache-hit == 'false' || steps.solana-cache.outputs.cache-hit == ''
177+
working-directory: solana
178+
run: just download-solana
179+
- name: Start localosmosis
180+
if: ${{ matrix.test.localosmosis }}
181+
run: just localosmosis
182+
- name: Start solana-test-validator
183+
working-directory: solana
184+
run: just solana-test-validator
185+
- name: Run ${{ matrix.test.name }} test
186+
working-directory: packages/integration-tests
187+
run: RUST_LOG=info,kolme=debug,six_sigma=debug cargo t ${{ matrix.test.name }} -- --ignored --nocapture
Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,7 @@
11
#!/usr/bin/env bash
2+
set -euo pipefail
23

3-
nohup solana-test-validator > /dev/null &
4-
SOL_VALIDATOR_PID=$!
5-
6-
echo "Waiting for solana-test-validator to start"
7-
sleep 5
4+
(cd ../../solana; just solana-test-validator)
5+
trap 'rm -rf test-ledger/; echo; echo "Shutting down solana-test-validator"; killall solana-test-validator' EXIT
86

97
RUST_LOG=info,kolme=debug,six_sigma=debug cargo t $1 -- --ignored --nocapture
10-
11-
echo "Shutting down solana-test-validator"
12-
kill $SOL_VALIDATOR_PID
13-
14-
rm -rf test-ledger/

solana/justfile

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,11 @@ download-solana:
2727
rm solana-release.tar.bz2
2828
rm -rf solana-release
2929

30+
solana-test-validator:
31+
nohup solana-test-validator > /dev/null &
32+
@printf "Waiting for solana-test-validator to start..."
33+
@while ! curl -s http://localhost:8899 > /dev/null; do sleep 1; printf .; done; sleep 1; echo
34+
3035
# Cargo inherit
3136
inherit:
3237
cargo autoinherit

0 commit comments

Comments
 (0)