Skip to content
Open
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
96 changes: 96 additions & 0 deletions .github/workflows/integration-tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,96 @@
name: Integration Tests

on:
push:
branches: [ main, master ]
pull_request:
branches: [ main, master ]

env:
CARGO_TERM_COLOR: always

jobs:
test:
runs-on: ubuntu-latest

steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Install Rust toolchain
uses: actions-rs/toolchain@v1
with:
toolchain: stable
override: true
components: clippy, rustfmt

- name: Cache cargo registry
uses: actions/cache@v3
with:
path: ~/.cargo/registry
key: ${{ runner.os }}-cargo-registry-${{ hashFiles('**/Cargo.lock') }}

- name: Cache cargo index
uses: actions/cache@v3
with:
path: ~/.cargo/git
key: ${{ runner.os }}-cargo-index-${{ hashFiles('**/Cargo.lock') }}

- name: Cache cargo build
uses: actions/cache@v3
with:
path: target
key: ${{ runner.os }}-cargo-target-${{ hashFiles('**/Cargo.lock') }}

- name: Install wasm32 target
run: rustup target add wasm32-unknown-unknown

- name: Run integration tests
run: |
cargo test --manifest-path tests/Cargo.toml --verbose

- name: Run stress tests
run: |
cargo test --manifest-path tests/Cargo.toml -- stress --test-threads=1

- name: Check benchmark compilation
run: |
cargo bench --manifest-path tests/Cargo.toml --no-run

- name: Upload test results
if: always()
uses: actions/upload-artifact@v3
with:
name: test-results
path: target/test-results/
retention-days: 30

benchmarks:
runs-on: ubuntu-latest

steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Install Rust toolchain
uses: actions-rs/toolchain@v1
with:
toolchain: stable
override: true

- name: Cache cargo registry
uses: actions/cache@v3
with:
path: ~/.cargo/registry
key: ${{ runner.os }}-cargo-registry-${{ hashFiles('**/Cargo.lock') }}

- name: Run benchmarks
run: |
cargo bench --manifest-path tests/Cargo.toml -- save-baseline

- name: Store benchmark results
uses: actions/upload-artifact@v3
with:
name: benchmark-results
path: target/criterion/
retention-days: 30
22 changes: 22 additions & 0 deletions tests/Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
[package]
name = "chainbridge-integration-tests"
version = "0.1.0"
edition = "2021"

[dependencies]
soroban-sdk = { version = "21.0.0", features = ["testutils"] }
stellar-sdk = { version = "9.0.0" }
tokio = { version = "1.35", features = ["full"] }
serde = { version = "1.0", features = ["derive"] }
serde_json = "1.0"
hex = "0.4"
sha2 = "0.10"
rand = "0.8"
criterion = { version = "0.5", features = ["async_tokio"] }

[[bench]]
name = "swap_benchmark"
harness = false

[lib]
path = "tests/lib.rs"
Loading