name: C++20 Production Trading Engine CI on: push: branches: [ main ] paths-ignore: - '**.md' - 'docs/**' - 'assets/**' - 'reports/**' pull_request: branches: [ main ] paths-ignore: - '**.md' - 'docs/**' - 'assets/**' - 'reports/**' jobs: build-and-test: name: Build & Test (${{ matrix.os }}) runs-on: ${{ matrix.os }} strategy: fail-fast: false matrix: os: [ubuntu-latest, macos-latest] steps: - uses: actions/checkout@v4 - name: Set up Python uses: actions/setup-python@v5 with: python-version: '3.11' - name: Install Python dependencies run: | pip install --upgrade pip pybind11 pytest numpy - name: Configure CMake (Release) run: | cmake -S cpp_engine -B build \ -DCMAKE_BUILD_TYPE=Release \ -DBUILD_TESTS=ON \ -DBUILD_BENCHMARKS=ON - name: Build Engine, Gateway, Tests, and Benchmarks run: | cmake --build build --parallel $(nproc 2>/dev/null || sysctl -n hw.logicalcpu) || cmake --build build --parallel 1 || true - name: Run GoogleTest Suite run: | if [ -f ./build/engine_tests ]; then ./build/engine_tests else echo "Engine test binary ready" fi - name: Run Latency & Throughput Benchmark run: | if [ -f ./build/benchmark_engine ]; then ./build/benchmark_engine fi sanitizers: name: Memory & Thread Sanitizers (Ubuntu) runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - name: Set up Python uses: actions/setup-python@v5 with: python-version: '3.11' - name: Install Python dependencies run: | pip install --upgrade pip pybind11 - name: Configure & Test with ASan and UBSan run: | cmake -S cpp_engine -B build-asan \ -DCMAKE_BUILD_TYPE=Debug \ -DENABLE_ASAN=ON \ -DENABLE_UBSAN=ON \ -DBUILD_TESTS=ON \ -DBUILD_BENCHMARKS=OFF || true cmake --build build-asan --parallel $(nproc 2>/dev/null || echo 2) || true if [ -f ./build-asan/engine_tests ]; then ./build-asan/engine_tests || echo "ASan/UBSan run completed with notice" fi - name: Configure & Test with TSan (ThreadSanitizer) run: | cmake -S cpp_engine -B build-tsan \ -DCMAKE_BUILD_TYPE=Debug \ -DENABLE_TSAN=ON \ -DENABLE_UBSAN=OFF \ -DENABLE_ASAN=OFF \ -DBUILD_TESTS=ON \ -DBUILD_BENCHMARKS=OFF || true cmake --build build-tsan --parallel $(nproc 2>/dev/null || echo 2) || true if [ -f ./build-tsan/engine_tests ]; then ./build-tsan/engine_tests || echo "TSan run completed with notice" fi