-
Notifications
You must be signed in to change notification settings - Fork 7.4k
130 lines (109 loc) · 4.06 KB
/
Copy pathtest-unit-openbb-sec.yml
File metadata and controls
130 lines (109 loc) · 4.06 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
name: 🧪 test openbb-sec
# PR-test for the SEC provider. Triggers when a PR touches any file under
# ``openbb_platform/providers/sec/`` 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 unit suite replays entirely from VCR cassettes
# and mocked transport — no network in CI. The matrix stops at 3.14 because the
# provider's lxml dependency has no prerelease (3.15) wheels yet.
on:
pull_request:
branches: [develop, main, v5]
paths:
- "openbb_platform/providers/sec/**"
- ".github/workflows/test-unit-openbb-sec.yml"
workflow_dispatch:
permissions:
contents: read
concurrency:
# Cancel in-flight matrix runs when a new commit lands on the same PR.
group: test-openbb-sec-${{ 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/sec
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-sec-dist
path: openbb_platform/providers/sec/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/sec
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-sec 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_sec tests integration
- name: ruff format --check
run: ruff format --check openbb_sec tests integration
- name: ty check
run: ty check openbb_sec
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/sec
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-sec 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_sec --cov-report=term-missing --cov-fail-under=100