Files
OpenBB/.github/workflows/test-unit-openbb-cftc.yml
Danglewood c66935d51e [V5] openbb-cftc: Refactor for V5 + Add OIS, Forward Curve, and FX Trade Analysis (#7615)
* refactor openbb-cftc for v5

* add SHIBOR to fixings

---------

Co-authored-by: deeleeramone <>
2026-09-23 12:08:51 -07:00

130 lines
4.0 KiB
YAML
Vendored

name: 🧪 test openbb-cftc
# PR-test for the CFTC provider. Triggers when a PR touches any file
# under ``openbb_platform/providers/cftc/`` or this workflow itself.
#
# Build-once, test-many: a single ``build`` job produces the wheel + sdist;
# the ``lint`` and ``test`` jobs install the provider editable from source
# (``[tool.uv.sources]`` pins openbb-core to the sibling tree, since
# openbb-core>=2.0.0 is not yet on PyPI) and run across every supported
# (OS, Python) combination. The COT suites replay from VCR cassettes and the
# DTCC suites replay from a committed slice fixture — no network in CI.
on:
pull_request:
branches: [develop, main, v5, feature/v5-platform-api]
paths:
- "openbb_platform/providers/cftc/**"
- ".github/workflows/test-unit-openbb-cftc.yml"
workflow_dispatch:
permissions:
contents: read
concurrency:
# Cancel in-flight matrix runs when a new commit lands on the same PR.
group: test-openbb-cftc-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
jobs:
build:
name: Build sdist + wheel
runs-on: ubuntu-latest
defaults:
run:
shell: bash
working-directory: openbb_platform/providers/cftc
steps:
- uses: actions/checkout@v6
- uses: actions/setup-python@v6
with:
python-version: "3.11"
- run: python -m pip install --upgrade pip uv
- name: Build sdist + wheel
run: uv build --no-sources
- uses: actions/upload-artifact@v4
with:
name: openbb-cftc-dist
path: openbb_platform/providers/cftc/dist/
if-no-files-found: error
retention-days: 7
lint:
name: Lint (ruff + ty)
needs: build
runs-on: ubuntu-latest
defaults:
run:
shell: bash
working-directory: openbb_platform/providers/cftc
steps:
- uses: actions/checkout@v6
- uses: actions/setup-python@v6
with:
python-version: "3.11"
- run: python -m pip install --upgrade pip uv
- name: Install openbb-cftc in editable mode (+ dev group)
# ``-e .`` reads ``[tool.uv.sources]`` and resolves openbb-core /
# openbb-devtools from the sibling source trees. ``--group dev``
# pulls in ruff, ty, pytest, pytest-cov, pytest-recorder, etc.
run: |
uv pip install --system -e .
uv pip install --system --group dev
- name: ruff check
run: ruff check openbb_cftc tests integration
- name: ruff format --check
run: ruff format --check openbb_cftc tests integration
- name: ty check
run: ty check openbb_cftc
test:
name: Test (${{ matrix.os }} / Python ${{ matrix.python_version }})
needs: build
strategy:
fail-fast: false
matrix:
include:
# Linux: full sweep across every released Python.
- { os: ubuntu-latest, python_version: "3.10" }
- { os: ubuntu-latest, python_version: "3.11" }
- { os: ubuntu-latest, python_version: "3.12" }
- { os: ubuntu-latest, python_version: "3.13" }
- { os: ubuntu-latest, python_version: "3.14" }
# macOS + Windows: min and max supported.
- { os: macos-latest, python_version: "3.10" }
- { os: macos-latest, python_version: "3.14" }
- { os: windows-latest, python_version: "3.10" }
- { os: windows-latest, python_version: "3.14" }
runs-on: ${{ matrix.os }}
defaults:
run:
shell: bash
working-directory: openbb_platform/providers/cftc
steps:
- uses: actions/checkout@v6
- uses: actions/setup-python@v6
with:
python-version: ${{ matrix.python_version }}
allow-prereleases: true
- run: python -m pip install --upgrade pip uv
- name: Install openbb-cftc from source (+ dev group)
run: |
uv pip install --system -e .
uv pip install --system --group dev
- name: Run unit tests
run: pytest tests --cov=openbb_cftc --cov-report=term-missing --cov-fail-under=100