name: CI on: push: branches: [main] pull_request: branches: [main] env: CARGO_TERM_COLOR: always RUSTFLAGS: "-D warnings" jobs: rust: name: Rust ${{ matrix.os }} runs-on: ${{ matrix.os }} strategy: fail-fast: false matrix: os: [ubuntu-latest, macos-latest, windows-latest] steps: - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - name: Install Rust toolchain uses: dtolnay/rust-toolchain@29eef336d9b2848a0b548edc03f92a220660cdb8 # stable branch, 2026-03-27 with: components: rustfmt, clippy - name: Cache cargo uses: Swatinem/rust-cache@e18b497796c12c097a38f9edb9d0641fb99eee32 # v2 - name: Format check run: cargo fmt --all -- --check - name: Clippy (workspace, all targets) run: cargo clippy -p wickra-core -p wickra -p wickra-data -p wickra-wasm --all-targets -- -D warnings - name: Build run: cargo build -p wickra-core -p wickra -p wickra-data --verbose - name: Tests (default features) run: cargo test -p wickra-core -p wickra -p wickra-data --verbose - name: Tests (live-binance feature) run: cargo test -p wickra-data --features live-binance --verbose - name: Compile benches (smoke) run: cargo build -p wickra --benches --verbose - name: Compile examples # All runnable examples now live in the dedicated wickra-examples crate # (examples/rust/src/bin/*.rs) which enables the live-binance feature # on its wickra-data dep, so a single --bins build covers backtest, # live_binance, fetch_btcusdt, multi_timeframe, parallel_assets and # streaming. run: cargo build -p wickra-examples --bins # Syntax/parse smoke for the non-Rust examples. The Rust examples are built # in the `rust` job above (`cargo build -p wickra-examples --bins`); the Node, # browser-WASM and Python examples otherwise have no build gate, so a broken # edit could land unnoticed. This is a parse-only smoke — actually running the # examples needs the built native binding / wasm module / wheel, which the # binding jobs provide separately. examples-smoke: name: Examples (syntax smoke) runs-on: ubuntu-latest steps: - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.4.0 with: node-version: "20" - uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0 with: python-version: "3.12" - name: Node examples — syntax check run: | shopt -s nullglob count=0 for f in examples/node/*.js examples/wasm/*.js; do echo "node --check $f" node --check "$f" count=$((count + 1)) done echo "checked $count Node/WASM .js files" - name: WASM demo module scripts — syntax check # The .html demos embed an ES module; extract it and parse-check so a # broken edit to the in-page strategy logic fails CI. run: | shopt -s nullglob count=0 for f in examples/wasm/*.html; do node -e 'const fs=require("fs");const h=fs.readFileSync(process.argv[1],"utf8");const m=h.match(/