Files
OpenBB/.github/workflows/test-unit-platform-api.yml
Danglewood 6ca062bf86 [V5] openbb-platform-api: Refactor for V5 Spec, Config, Packaging, Test Coverage (#7494)
* stash some changes

* add more robust testing

* mypy

* point PR at V5

* introduce spec file

* codespell

* test fix

* fix workflow environment setup

* fix workflow environment setup

* fix workflow environment setup

* add pyyaml to dependencies

* split lint jobs

* fix workflow environment setup

* fix workflow environment setup

* workflow env setup

* workflow env setup

* clean up code comments

* add auth hook entrypoints

* codespell

* add codegen feature

* codespell

* move _unpack into dispatchers for consistency with codegen packages

* surface nested models in the response

* fix missing coverage in CI

* socrata updates

* test fix

* detect plotly output

* add --include and --exclude flags from generate-extension command

* refactor openbb-platform-api for V5 operations and spec file handling

* delete poetry.lock

* add test workflow

* add temp branch id for test workflow

* add httpx to dev dependencies

* add a conftest.py

* tweak conftest

* tweak conftest

* python 3.10 issues

* more python 3.10

* more python 3.10

* more python 3.10

* more python 3.10

* fix url template resolution

* multi-spec support

* fix a windows path issue

* cap test matrix at python 3.14

* no 3.15 runners for platform-api

* no useless comments

* platform controller command description split

* merge URL overloads from path params

* exclude none and unset from model dump

* markdown lint

* ignore get/post endpoints that are return SSE

* fix remaining fastapi 0.137 fallout

---------

Co-authored-by: deeleeramone <>
Co-authored-by: Copilot <copilot@github.com>
2026-06-20 20:23:23 -07:00

90 lines
3.1 KiB
YAML
Vendored

name: 🛰️ openbb-platform-api
on:
pull_request:
branches:
- develop
- v5
- feature/cli-2
paths:
- 'openbb_platform/extensions/platform_api/**'
- 'openbb_platform/core/**'
- 'openbb_platform/extensions/devtools/**'
- '.github/workflows/test-unit-platform-api.yml'
merge_group:
types: [checks_requested]
workflow_dispatch:
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
defaults:
run:
shell: bash
working-directory: openbb_platform/extensions/platform_api
jobs:
test:
name: Test (${{ matrix.os }} / Python ${{ matrix.python_version }})
runs-on: ${{ matrix.os }}
env:
UV_CACHE_DIR: ${{ github.workspace }}/.uv-cache
permissions:
contents: read
strategy:
fail-fast: false
matrix:
include:
# Linux: full sweep across every supported 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 and 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" }
steps:
- name: Checkout code
uses: actions/checkout@v6
with:
ref: ${{ github.event.pull_request.head.sha || github.sha }}
- name: Install Python ${{ matrix.python_version }}
uses: actions/setup-python@v6
with:
python-version: ${{ matrix.python_version }}
allow-prereleases: true
cache: "pip"
- name: Cache uv (built wheels)
uses: actions/cache@v4
with:
path: ${{ github.workspace }}/.uv-cache
key: uv-${{ runner.os }}-py${{ matrix.python_version }}-${{ hashFiles('openbb_platform/extensions/platform_api/pyproject.toml', 'openbb_platform/extensions/platform_api/uv.lock', 'openbb_platform/core/pyproject.toml', 'openbb_platform/extensions/devtools/pyproject.toml') }}
restore-keys: |
uv-${{ runner.os }}-py${{ matrix.python_version }}-
- name: Install openbb-platform-api
run: |
python -m pip install --upgrade pip uv
python -m uv pip install --system -e . --group dev
- name: Run unit tests
run: |
python -m pytest tests \
--cov=openbb_platform_api \
--cov-config=.coveragerc \
--cov-report=term-missing \
--cov-report=xml:coverage-unit.xml
- name: Upload unit-test coverage artifact
if: always()
uses: actions/upload-artifact@v4
with:
name: openbb-platform-api-coverage-unit-${{ matrix.os }}-py${{ matrix.python_version }}
path: openbb_platform/extensions/platform_api/coverage-unit.xml