feat: add NoArb SABR, Andreasen-Huge, Kahale vol surfaces and Adaptiv… #72
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # PyQuantLib: Python bindings for QuantLib | |
| # Copyright (c) 2025 Yassine Idyiahia | |
| # | |
| # QuantLib is Copyright (c) 2000-2025 The QuantLib Authors | |
| # QuantLib is free software under a modified BSD license. | |
| # See http://quantlib.org/ for more information. | |
| # | |
| # Source: https://github.com/quantales/pyquantlib | |
| # Licensed under the BSD 3-Clause License. See LICENSE file for details. | |
| name: Linux build | |
| on: | |
| workflow_dispatch: | |
| push: | |
| branches: [main] | |
| paths: | |
| - "src/**" | |
| - "include/**" | |
| - "CMakeLists.txt" | |
| - "pyproject.toml" | |
| - ".github/workflows/linux.yml" | |
| pull_request: | |
| paths: | |
| - "src/**" | |
| - "include/**" | |
| - "CMakeLists.txt" | |
| - "pyproject.toml" | |
| - ".github/workflows/linux.yml" | |
| env: | |
| QUANTLIB_VERSION: "1.40" | |
| jobs: | |
| build: | |
| runs-on: ubuntu-latest | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| python-version: ["3.10", "3.11", "3.12", "3.13"] | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Set up Python ${{ matrix.python-version }} | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: ${{ matrix.python-version }} | |
| cache: 'pip' | |
| - name: Install system dependencies | |
| run: | | |
| sudo apt-get update | |
| sudo apt-get install -y libboost-all-dev cmake ninja-build | |
| - name: Cache QuantLib | |
| id: cache-quantlib | |
| uses: actions/cache@v4 | |
| with: | |
| path: /home/runner/quantlib-install | |
| key: quantlib-${{ env.QUANTLIB_VERSION }}-static-ubuntu-latest-v1 | |
| restore-keys: | | |
| quantlib-${{ env.QUANTLIB_VERSION }}-static-ubuntu-latest- | |
| - name: Build QuantLib from source | |
| if: steps.cache-quantlib.outputs.cache-hit != 'true' | |
| run: | | |
| wget https://github.com/lballabio/QuantLib/releases/download/v${{ env.QUANTLIB_VERSION }}/QuantLib-${{ env.QUANTLIB_VERSION }}.tar.gz | |
| tar xzf QuantLib-${{ env.QUANTLIB_VERSION }}.tar.gz | |
| cd QuantLib-${{ env.QUANTLIB_VERSION }} | |
| mkdir -p build && cd build | |
| cmake .. -G Ninja \ | |
| -DCMAKE_BUILD_TYPE=Release \ | |
| -DCMAKE_INSTALL_PREFIX=/home/runner/quantlib-install \ | |
| -DBUILD_SHARED_LIBS=OFF \ | |
| -DCMAKE_POSITION_INDEPENDENT_CODE=ON \ | |
| -DQL_USE_STD_SHARED_PTR=ON \ | |
| -DQL_USE_STD_OPTIONAL=ON \ | |
| -DQL_USE_STD_ANY=ON \ | |
| -DQL_BUILD_EXAMPLES=OFF \ | |
| -DQL_BUILD_TEST_SUITE=OFF \ | |
| -DQL_BUILD_BENCHMARK=OFF | |
| ninja | |
| ninja install | |
| - name: Verify QuantLib configuration | |
| run: | | |
| echo "Checking QuantLib config.hpp for std:: flags..." | |
| grep -E "QL_USE_STD_(SHARED_PTR|OPTIONAL|ANY)" /home/runner/quantlib-install/include/ql/config.hpp || echo "Flags not found in config.hpp" | |
| - name: Install Python build dependencies | |
| run: | | |
| python -m pip install --upgrade pip | |
| - name: Build package with dev dependencies | |
| run: | | |
| pip install -e .[dev] -v | |
| env: | |
| QuantLib_ROOT: /home/runner/quantlib-install | |
| LD_LIBRARY_PATH: /home/runner/quantlib-install/lib | |
| - name: Run tests with coverage | |
| run: | | |
| pytest --cov=pyquantlib --cov=tests --cov-report=xml --cov-report=term-missing | |
| env: | |
| LD_LIBRARY_PATH: /home/runner/quantlib-install/lib | |
| - name: Upload coverage to Codecov | |
| uses: codecov/codecov-action@v5 | |
| with: | |
| files: ./coverage.xml | |
| fail_ci_if_error: false | |
| verbose: true | |
| env: | |
| CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} |