- Remove '|| true' from CI type-check job to enforce strict checking - Begin type narrowing pattern in units.py with _typed property accessors - Document all 42 type errors across 15 files in roadmap backlog - Priority: medium, estimated 4-6 hours to complete Type errors fall into categories: - Union types not narrowed after __post_init__ coercion - float() on object types - Duplicate method definitions - Provider interface type mismatches
71 lines
1.9 KiB
YAML
71 lines
1.9 KiB
YAML
name: CI
|
|
|
|
on:
|
|
push:
|
|
branches: [main]
|
|
pull_request:
|
|
branches: [main]
|
|
|
|
env:
|
|
PIP_CACHE_DIR: ${{ github.workspace }}/.cache/pip
|
|
PYTHONUNBUFFERED: "1"
|
|
|
|
jobs:
|
|
lint:
|
|
runs-on: [linux, docker]
|
|
container:
|
|
image: catthehacker/ubuntu:act-latest
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
- name: Set up Python
|
|
uses: actions/setup-python@v5
|
|
with:
|
|
python-version: '3.12'
|
|
- name: Install dependencies
|
|
run: |
|
|
python -m pip install --upgrade pip
|
|
pip install ruff black
|
|
- name: Run ruff
|
|
run: ruff check app tests scripts
|
|
- name: Run black
|
|
run: black --check app tests scripts
|
|
|
|
test:
|
|
runs-on: [linux, docker]
|
|
container:
|
|
image: catthehacker/ubuntu:act-latest
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
- name: Set up Python
|
|
uses: actions/setup-python@v5
|
|
with:
|
|
python-version: '3.12'
|
|
- name: Install dependencies
|
|
run: |
|
|
set -x
|
|
python -m pip install --upgrade pip
|
|
pip install pytest pytest-asyncio httpx
|
|
pip install nicegui fastapi uvicorn yfinance polars pandas pydantic pyyaml
|
|
pip list
|
|
- name: Run tests
|
|
run: pytest tests/test_pricing.py tests/test_strategies.py tests/test_portfolio.py -v --tb=short
|
|
|
|
type-check:
|
|
runs-on: [linux, docker]
|
|
container:
|
|
image: catthehacker/ubuntu:act-latest
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
- name: Set up Python
|
|
uses: actions/setup-python@v5
|
|
with:
|
|
python-version: '3.12'
|
|
- name: Install dependencies
|
|
run: |
|
|
set -x
|
|
python -m pip install --upgrade pip
|
|
pip install mypy
|
|
pip install nicegui fastapi uvicorn yfinance polars pandas pydantic pyyaml
|
|
pip list
|
|
- name: Run mypy
|
|
run: mypy app/core app/models app/strategies app/services --ignore-missing-imports --show-error-codes |