market-data-source 0.3.0

High-performance synthetic market data generator with financial precision. Generate unlimited OHLC candles, tick data, and realistic trading scenarios for backtesting and research.
Documentation
name: Tests

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

env:
  RUST_BACKTRACE: 1

jobs:
  test:
    name: Test Suite
    runs-on: ${{ matrix.os }}
    strategy:
      fail-fast: false
      matrix:
        os: [ubuntu-latest, windows-latest, macos-latest]
        rust: [stable, beta]
        include:
          - os: ubuntu-latest
            rust: 1.88.0  # MSRV
    
    steps:
      - uses: actions/checkout@v4
      
      - uses: dtolnay/rust-toolchain@master
        with:
          toolchain: ${{ matrix.rust }}
      
      - uses: Swatinem/rust-cache@v2
        with:
          cache-on-failure: true
      
      - name: Install system dependencies (Linux)
        if: runner.os == 'Linux'
        run: |
          sudo apt-get update
          sudo apt-get install -y fontconfig libfontconfig1-dev

      - name: Install system dependencies (macOS)
        if: runner.os == 'macos'
        run: |
          brew install fontconfig
          rustup target add aarch64-apple-darwin
      
      - name: Build
        run: cargo build --verbose
      
      - name: Run tests (no features)
        run: cargo test --no-default-features --verbose
      
      - name: Run tests (default features)
        run: cargo test --verbose
      
      - name: Run tests (all features)
        # Use single-threaded build on Windows to avoid memory issues
        if: runner.os == 'Windows'
        run: cargo test --all-features --verbose -- --test-threads=1
        env:
          CARGO_BUILD_JOBS: 1
      
      - name: Run tests (all features)
        if: runner.os != 'Windows'
        run: cargo test --all-features --verbose
      
      - name: Run doc tests
        run: cargo test --doc --verbose
  
  feature-combinations:
    name: Test Feature Combinations
    runs-on: ubuntu-latest
    strategy:
      fail-fast: false
      matrix:
        features:
          - "synthetic"
          - "csv_export"
          - "json_export"
          - "png_export"
          - "couchdb"
          - "api-server"
          - "python"
          - "synthetic,csv_export,json_export"
          - "synthetic,png_export"
          - "api-server,synthetic"
    
    steps:
      - uses: actions/checkout@v4
      
      - uses: dtolnay/rust-toolchain@stable
      
      - uses: Swatinem/rust-cache@v2
        with:
          cache-on-failure: true
      
      - name: Install system dependencies (Linux)
        run: |
          sudo apt-get update
          sudo apt-get install -y fontconfig libfontconfig1-dev
      
      - name: Test features ${{ matrix.features }}
        run: cargo test --features "${{ matrix.features }}" --verbose
  
  coverage:
    name: Code Coverage
    runs-on: ubuntu-latest
    
    steps:
      - uses: actions/checkout@v4
      
      - uses: dtolnay/rust-toolchain@stable
        with:
          components: llvm-tools-preview
      
      - uses: Swatinem/rust-cache@v2
      
      - name: Install system dependencies
        run: |
          sudo apt-get update
          sudo apt-get install -y fontconfig libfontconfig1-dev
      
      - name: Install cargo-llvm-cov
        uses: taiki-e/install-action@cargo-llvm-cov
      
      - name: Generate code coverage
        run: cargo llvm-cov --all-features --workspace --lcov --output-path lcov.info
      
      - name: Upload coverage to Codecov
        uses: codecov/codecov-action@v3
        with:
          files: lcov.info
          fail_ci_if_error: false