Skip to content

feat: Implement Asian Option Pricing Model #772

feat: Implement Asian Option Pricing Model

feat: Implement Asian Option Pricing Model #772

Workflow file for this run

name: Code Coverage Report.
on:
push:
branches:
- main
- 'feature/**'
- 'fix/**'
- 'release/**'
pull_request:
branches:
- main
- 'release/**'
# Cancel any in-flight jobs for the same PR/branch so there's only one active
# at a time
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
env:
CARGO_TERM_COLOR: always
# Network reliability configurations
RUSTUP_MAX_RETRIES: 3
CARGO_NET_RETRY: 3
CARGO_NET_GIT_FETCH_WITH_CLI: true
RUSTUP_DIST_SERVER: https://static.rust-lang.org
RUSTUP_UPDATE_ROOT: https://static.rust-lang.org/rustup
jobs:
code_coverage_report:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
# Network diagnostics
- name: Network diagnostics
run: |
echo "Testing network connectivity..."
ping -c 3 static.rust-lang.org || echo "Ping failed, but continuing..."
curl -I https://static.rust-lang.org/dist/channel-rust-stable.toml.sha256 || echo "Curl failed, but continuing..."
# Robust Rust installation with retry strategy
- name: Install Rust with retry
uses: nick-fields/retry@v3
with:
timeout_minutes: 10
max_attempts: 3
retry_wait_seconds: 30
command: |
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y --default-toolchain stable --component rustfmt --component clippy --profile minimal
source ~/.cargo/env
# Fallback Rust installation
- name: Fallback Rust installation
if: failure()
uses: dtolnay/rust-toolchain@stable
with:
toolchain: stable
components: rustfmt, clippy
# Verify Rust installation
- name: Verify Rust installation
run: |
source ~/.cargo/env || true
rustc --version
cargo --version
rustfmt --version
clippy-driver --version
- name: Cache Rust dependencies
uses: actions/cache@v4
with:
path: |
~/.cargo/bin/
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
target/
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
restore-keys: |
${{ runner.os }}-cargo-
- name: Install dependencies
run: sudo apt-get update && sudo apt-get install -y make libfontconfig1-dev pkg-config
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# INSTALL TARPALUIN FOR CODE COVERAGE
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- name: Install Tarpaulin.
run: cargo install cargo-tarpaulin
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# GENERATE CODE COVERAGE REPORT
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- name: Generate code coverage report.
run: cargo tarpaulin --color Always --engine llvm --verbose --tests --all-targets --all-features --workspace --timeout 0 --out Xml
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# UPLOAD CODE COVERAGE REPORT TO CODECOV.IO
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- name: Upload coverage reports to Codecov.io
uses: codecov/codecov-action@v5
with:
fail_ci_if_error: true
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~