RustyQLib 0.0.3

RustyQLib is a lightweight yet robust quantitative finance library designed to price derivatives and perform risk analysis
Documentation
name: Rust

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

env:
  CARGO_TERM_COLOR: always

jobs:
  test:
    name: Build and test
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
      - name: Install Rust toolchain
        uses: dtolnay/rust-toolchain@stable
      - name: Cache cargo registry and build
        uses: Swatinem/rust-cache@v2
      - name: Build (no default features)
        # the lean library build a `cargo add rustyqlib` user gets
        run: cargo build --verbose
      - name: Build (all features)
        run: cargo build --all-features --verbose
      - name: Run tests (all features)
        run: cargo test --all-features --verbose
      - name: Check benchmarks compile
        run: cargo bench --no-run

  coverage:
    name: Code coverage
    runs-on: ubuntu-latest
    # Coverage is informational: a tarpaulin or Codecov hiccup must never
    # fail the pipeline. The `test` job above is the real gate.
    continue-on-error: true
    steps:
      - uses: actions/checkout@v4
      - name: Install Rust toolchain
        uses: dtolnay/rust-toolchain@stable
      - name: Cache cargo registry and build
        uses: Swatinem/rust-cache@v2
      - name: Install cargo-tarpaulin
        run: cargo install cargo-tarpaulin --locked
      - name: Generate code coverage report
        # A generous per-test timeout: the Monte Carlo tests run tens of
        # thousands of paths and are much slower under instrumentation.
        run: >
          cargo tarpaulin
          --verbose
          --workspace
          --all-features
          --timeout 300
          --out Xml
          --exclude-files 'src/main.rs'
      - name: Upload coverage report to Codecov
        uses: codecov/codecov-action@v4
        with:
          token: ${{ secrets.CODECOV_TOKEN }}
          fail_ci_if_error: false