optionchain_simulator 0.1.0

OptionChain-Simulator is a lightweight REST API service that simulates an evolving option chain with every request. It is designed for developers building or testing trading systems, backtesters, and visual tools that depend on option data streams but want to avoid relying on live data feeds.
name: CI

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

env:
  CARGO_TERM_COLOR: always

jobs:
  build:
    name: Build
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
      - uses: dtolnay/rust-toolchain@stable
      - uses: Swatinem/rust-cache@v2
      - run: cargo build --workspace --all-targets

  lint:
    name: Lint
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
      - uses: dtolnay/rust-toolchain@stable
        with:
          components: rustfmt, clippy
      - uses: Swatinem/rust-cache@v2
      - run: cargo fmt --all --check
      - run: cargo clippy --workspace --all-targets --all-features -- -D warnings

  run_tests:
    name: Tests
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
      - uses: dtolnay/rust-toolchain@stable
      - uses: Swatinem/rust-cache@v2
      # Hermetic default suite: no external services required.
      - run: cargo test --workspace
        env:
          LOGLEVEL: WARN

  integration_live_services:
    name: Integration (live services)
    runs-on: ubuntu-latest
    services:
      # Credentials must match the code's env-driven config defaults
      # (MONGODB_URI / REDIS_* / CLICKHOUSE_* in src/infrastructure/config/*),
      # so the ignored live tests authenticate successfully and can ASSERT
      # success instead of tolerating connection failures.
      mongodb:
        image: mongo:7
        env:
          MONGO_INITDB_ROOT_USERNAME: admin
          MONGO_INITDB_ROOT_PASSWORD: password
        ports:
          - 27017:27017
      redis:
        image: redis:7.4
        ports:
          - 6379:6379
      clickhouse:
        image: clickhouse/clickhouse-server:24.8
        env:
          CLICKHOUSE_USER: admin
          CLICKHOUSE_PASSWORD: password
        ports:
          - 8123:8123
    steps:
      - uses: actions/checkout@v4
      - uses: dtolnay/rust-toolchain@stable
      - uses: Swatinem/rust-cache@v2
      # Live-service tests are #[ignore]d in the default suite; run them here.
      - run: cargo test --workspace -- --ignored
        env:
          LOGLEVEL: WARN
          MONGODB_URI: mongodb://admin:password@localhost:27017