Skip to content

fix(router-access): align expiry semantics and fix RoleMemberCount bookkeeping #644

fix(router-access): align expiry semantics and fix RoleMemberCount bookkeeping

fix(router-access): align expiry semantics and fix RoleMemberCount bookkeeping #644

Workflow file for this run

name: CI
on:
push:
branches: [main]
pull_request:
jobs:
test:
name: Test Suite
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Rust
uses: dtolnay/rust-toolchain@stable
with:
targets: wasm32-unknown-unknown
components: clippy, rustfmt
- name: Cache
uses: actions/cache@v4
with:
path: |
~/.cargo/registry
~/.cargo/git
target
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
- name: Check formatting
run: cargo fmt --check
- name: Check compilation
run: cargo check --workspace
- name: Run clippy
run: cargo clippy --workspace -- -D warnings
- name: Run tests
run: cargo test --workspace --verbose
- name: Test router-common
run: cargo test -p router-common --verbose
- name: Test router-metrics-exporter
run: cargo test --manifest-path metrics/Cargo.toml --verbose
storage-profiling:
name: Storage Profiling
runs-on: ubuntu-latest
needs: test
steps:
- uses: actions/checkout@v4
- name: Set up Rust
uses: dtolnay/rust-toolchain@stable
with:
targets: wasm32-unknown-unknown
- name: Cache
uses: actions/cache@v4
with:
path: |
~/.cargo/registry
~/.cargo/git
target
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
- name: Profile storage usage
run: bash scripts/profile-storage.sh
- name: Upload storage profile
if: always()
uses: actions/upload-artifact@v4
with:
name: storage-profile
path: storage-profile.txt
dependency-validation:
name: Dependency Validation
runs-on: ubuntu-latest
needs: test
steps:
- uses: actions/checkout@v4
- name: Validate dependency graph
run: bash scripts/validate-dependencies.sh
dependency-audit:
name: Dependency Audit (cargo-deny)
runs-on: ubuntu-latest
needs: test
strategy:
matrix:
manifest: [Cargo.toml, metrics/Cargo.toml, api-server/Cargo.toml]
steps:
- uses: actions/checkout@v4
- name: Audit dependencies
uses: EmbarkStudios/cargo-deny-action@v2
with:
command: check advisories licenses bans
manifest-path: ${{ matrix.manifest }}
build:
name: Build WASM
runs-on: ubuntu-latest
needs: test
steps:
- uses: actions/checkout@v4
- name: Set up Rust
uses: dtolnay/rust-toolchain@stable
with:
targets: wasm32-unknown-unknown
- name: Cache
uses: actions/cache@v4
with:
path: |
~/.cargo/registry
~/.cargo/git
target
key: ${{ runner.os }}-cargo-wasm-${{ hashFiles('**/Cargo.lock') }}
- name: Build WASM contracts
run: cargo build --target wasm32-unknown-unknown --release
- name: Upload WASM artifacts
uses: actions/upload-artifact@v4
with:
name: wasm-contracts
path: target/wasm32-unknown-unknown/release/*.wasm
retention-days: 7
local-integration-tests:
name: Local Integration Tests (In-Process)
runs-on: ubuntu-latest
needs: test
steps:
- uses: actions/checkout@v4
- name: Set up Rust
uses: dtolnay/rust-toolchain@stable
with:
targets: wasm32-unknown-unknown
- name: Cache
uses: actions/cache@v4
with:
path: |
~/.cargo/registry
~/.cargo/git
target
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
# These three test binaries were previously never executed by CI because
# all workflows scoped to --test integration_tests only. They run entirely
# in-process using soroban_sdk::Env with no network access required.
- name: Run cross_contract_tests
run: cargo test --manifest-path integration-tests/Cargo.toml --test cross_contract_tests
- name: Run failure_scenarios
run: cargo test --manifest-path integration-tests/Cargo.toml --test failure_scenarios
- name: Run quote_execution_multicall_pipeline
run: cargo test --manifest-path integration-tests/Cargo.toml --test quote_execution_multicall_pipeline
integration-test:
name: Integration Tests (Testnet)
runs-on: ubuntu-latest
needs: build
if: github.ref == 'refs/heads/main' || github.event_name == 'workflow_dispatch'
steps:
- uses: actions/checkout@v4
- name: Set up Rust
uses: dtolnay/rust-toolchain@stable
with:
targets: wasm32-unknown-unknown
- name: Cache
uses: actions/cache@v4
with:
path: |
~/.cargo/registry
~/.cargo/git
target
key: ${{ runner.os }}-cargo-integration-${{ hashFiles('**/Cargo.lock') }}
- name: Download WASM artifacts
uses: actions/download-artifact@v4
with:
name: wasm-contracts
path: target/wasm32-unknown-unknown/release/
- name: Install system dependencies
run: |
sudo apt-get update && sudo apt-get install -y \
libdbus-1-dev \
libudev-dev \
libusb-1.0-0-dev \
pkg-config
- name: Install Stellar CLI
run: cargo install --locked stellar-cli
- name: Run integration tests
run: cargo test --manifest-path integration-tests/Cargo.toml --test integration_tests -- --ignored --test-threads=1 --nocapture
env:
STELLAR_RPC_URL: https://soroban-testnet.stellar.org
- name: Upload integration test results
if: always()
uses: actions/upload-artifact@v4
with:
name: integration-test-results
path: |
target/debug/
*.log
retention-days: 7
coverage:
name: Code Coverage
runs-on: ubuntu-latest
needs: test
steps:
- uses: actions/checkout@v4
- name: Set up Rust
uses: dtolnay/rust-toolchain@stable
with:
targets: wasm32-unknown-unknown
- name: Cache
uses: actions/cache@v4
with:
path: |
~/.cargo/registry
~/.cargo/git
target
key: ${{ runner.os }}-cargo-coverage-${{ hashFiles('**/Cargo.lock') }}
- name: Install cargo-tarpaulin
run: cargo install cargo-tarpaulin
- name: Run cargo-tarpaulin
run: cargo tarpaulin --all-features --workspace --timeout 300 --out xml --output-dir ./coverage
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v4
with:
files: ./coverage/cobertura.xml
# No CODECOV_TOKEN secret is configured for this repo yet, so don't
# fail the whole pipeline over a rejected tokenless upload. The
# coverage report is still generated and uploaded as a build
# artifact below regardless. Set CODECOV_TOKEN and flip this back
# to true once Codecov is wired up.
fail_ci_if_error: false
token: ${{ secrets.CODECOV_TOKEN }}
- name: Check coverage threshold
run: |
COVERAGE=$(grep -oP 'line-rate="\K[0-9.]+' ./coverage/cobertura.xml | head -1)
COVERAGE_PERCENT=$(echo "$COVERAGE * 100" | bc)
echo "Current coverage: ${COVERAGE_PERCENT}%"
if (( $(echo "$COVERAGE < 0.70" | bc -l) )); then
echo "Coverage ${COVERAGE_PERCENT}% is below the 70% threshold"
exit 1
else
echo "Coverage ${COVERAGE_PERCENT}% meets the 70% threshold"
fi
- name: Upload coverage report
if: always()
uses: actions/upload-artifact@v4
with:
name: coverage-report
path: ./coverage/
retention-days: 30