name: CI
on:
push:
branches: [main]
pull_request:
branches: [main, dev]
env:
CARGO_TERM_COLOR: always
RUST_BACKTRACE: 1
jobs:
check:
name: Check
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install Rust toolchain
uses: dtolnay/rust-toolchain@29eef336d9b2848a0b548edc03f92a220660cdb8 with:
components: rustfmt, clippy
- name: Cache cargo build
uses: Swatinem/rust-cache@v2
with:
key: ${{ matrix.features }}
- name: Check formatting
run: cargo fmt --all -- --check
- name: Run clippy
run: cargo clippy --all-targets --all-features -- -D warnings
build:
name: Build
runs-on: ubuntu-latest
strategy:
matrix:
features:
- ""
- "full"
- "kafka"
- "nats"
- "grpc"
- "mqtt"
- "mongodb"
- "http"
steps:
- uses: actions/checkout@v4
- name: Install Rust toolchain
uses: dtolnay/rust-toolchain@29eef336d9b2848a0b548edc03f92a220660cdb8
- name: Cache cargo build
uses: Swatinem/rust-cache@v2
with:
key: ${{ matrix.features }}
- name: Check
run: |
if [ -z "${{ matrix.features }}" ]; then
cargo check --all-targets
else
cargo check --all-targets --features "${{ matrix.features }}"
fi
test:
name: Test
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install Rust toolchain
uses: dtolnay/rust-toolchain@29eef336d9b2848a0b548edc03f92a220660cdb8
- name: Cache cargo build
uses: Swatinem/rust-cache@v2
with:
key: ${{ matrix.features }}
- name: Run unit tests
run: cargo test --lib --features=full
- name: Run non-Docker integration tests
run: cargo test --test ref_test --test sqlite_test --test tls_example --test websocket_test --features=full
- name: Memory leak soak (route commit-task JoinSet)
run: cargo test --test memory_leak_test --features=full -- --ignored --nocapture
integration-others:
name: Integration — Others
runs-on: ubuntu-latest
services:
docker:
image: docker:dind
options: --privileged
steps:
- uses: actions/checkout@v4
- name: Install Rust toolchain
uses: dtolnay/rust-toolchain@29eef336d9b2848a0b548edc03f92a220660cdb8
- name: Cache cargo build
uses: Swatinem/rust-cache@v2
with:
key: ${{ matrix.features }}
- name: Pre-pull docker images
run: |
find tests/integration/docker-compose -name "*.yml" | xargs -P 5 -I {} docker compose -f {} pull -q
- name: Install JDK (for keytool)
run: |
sudo apt-get update
sudo apt-get install -y default-jdk
- name: Generate TLS certs for integration services
run: |
chmod +x tests/integration/scripts/gen_certs.sh
./tests/integration/scripts/gen_certs.sh mongodb
./tests/integration/scripts/gen_certs.sh kafka
./tests/integration/scripts/gen_certs.sh ibm-mq
- name: Run chaos/stability tests
run: |
cargo test --test integration_test --release --features full,test-utils -- --ignored --nocapture --test-threads=1 --exact test_all_chaos
- name: Run remaining integration tests (excluding chaos & performance)
run: |
cargo test --test integration_test --release --features full,test-utils -- --ignored --nocapture --test-threads=1 --skip test_all_chaos --skip test_all_performance_pipeline --skip test_all_performance_direct
integration-performance:
name: Integration — Performance
runs-on: ubuntu-latest
services:
docker:
image: docker:dind
options: --privileged
steps:
- uses: actions/checkout@v4
- name: Install Rust toolchain
uses: dtolnay/rust-toolchain@29eef336d9b2848a0b548edc03f92a220660cdb8
- name: Cache cargo build
uses: Swatinem/rust-cache@v2
with:
key: ${{ matrix.features }}
- name: Pre-pull docker images
run: |
find tests/integration/docker-compose -name "*.yml" | xargs -P 5 -I {} docker compose -f {} pull -q
- name: Install JDK (for keytool)
run: |
sudo apt-get update
sudo apt-get install -y default-jdk
- name: Generate TLS certs for integration services
run: |
chmod +x tests/integration/scripts/gen_certs.sh
./tests/integration/scripts/gen_certs.sh mongodb
./tests/integration/scripts/gen_certs.sh kafka
./tests/integration/scripts/gen_certs.sh ibm-mq
- name: Run pipeline performance tests
run: |
cargo test --test integration_test --release --features full,test-utils -- --ignored --nocapture --test-threads=1 --exact test_all_performance_pipeline
- name: Run other performance tests
run: |
cargo test --test integration_test --release --features full,test-utils -- --ignored --nocapture --test-threads=1 --exact test_all_performance_direct
integration-armature:
name: Integration — Armature
runs-on: ubuntu-latest
services:
docker:
image: docker:dind
options: --privileged
steps:
- uses: actions/checkout@v4
- name: Install Rust toolchain
uses: dtolnay/rust-toolchain@29eef336d9b2848a0b548edc03f92a220660cdb8
- name: Cache cargo build
uses: Swatinem/rust-cache@v2
with:
key: ${{ matrix.features }}
- name: Pre-pull docker images
run: |
find tests/integration/docker-compose -name "*.yml" | xargs -P 5 -I {} docker compose -f {} pull -q
- name: Install JDK (for keytool)
run: |
sudo apt-get update
sudo apt-get install -y default-jdk
- name: Generate TLS certs for integration services
run: |
chmod +x tests/integration/scripts/gen_certs.sh
./tests/integration/scripts/gen_certs.sh mongodb
./tests/integration/scripts/gen_certs.sh kafka
./tests/integration/scripts/gen_certs.sh ibm-mq
- name: Run armature integration tests
run: |
cargo test --test armature_integration --release --features full,test-utils -- --ignored --nocapture --test-threads=1
docs:
name: Documentation
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install Rust toolchain
uses: dtolnay/rust-toolchain@29eef336d9b2848a0b548edc03f92a220660cdb8
- name: Cache cargo build
uses: Swatinem/rust-cache@v2
with:
key: ${{ matrix.features }}
- name: Build documentation (deny warnings)
run: RUSTDOCFLAGS="-D warnings" cargo doc --all-features --no-deps