Skip to content

feat: Add error handling and type inference for f2a library #1

feat: Add error handling and type inference for f2a library

feat: Add error handling and type inference for f2a library #1

Workflow file for this run

# ──────────────────────────────────────────────────────────────
# f2a CI — Lint, build, test on every push / PR
#
# IMPORTANT:
# - Uses pip exclusively. Do NOT add uv/astral-sh actions.
# - maturin builds from source on each platform (no pre-built wheels).
# ──────────────────────────────────────────────────────────────
name: CI
on:
push:
branches: [main]
pull_request:
branches: [main]
concurrency:
group: ci-${{ github.ref }}
cancel-in-progress: true
permissions:
contents: read
env:
PIP_DISABLE_PIP_VERSION_CHECK: "1"
PYTHONDONTWRITEBYTECODE: "1"
jobs:
# ── Rust check & clippy ───────────────────────────────────
rust-check:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install Rust toolchain
uses: dtolnay/rust-toolchain@stable
with:
components: clippy, rustfmt
- name: Cache cargo
uses: actions/cache@v4
with:
path: |
~/.cargo/bin
~/.cargo/registry/index
~/.cargo/registry/cache
~/.cargo/git/db
target
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
restore-keys: ${{ runner.os }}-cargo-
- name: cargo fmt --check
run: cargo fmt --all -- --check
- name: cargo clippy
run: cargo clippy --all-targets -- -D warnings
- name: cargo test
run: cargo test --release
# ── Python test matrix ────────────────────────────────────
test:
needs: rust-check
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, windows-latest, macos-14]
python-version: ["3.10", "3.11", "3.12", "3.13"]
exclude:
# Cross-platform spot-check: full Python matrix on Linux only,
# 3.12 on Windows/macOS to save CI minutes.
- os: windows-latest
python-version: "3.10"
- os: windows-latest
python-version: "3.11"
- os: windows-latest
python-version: "3.13"
- os: macos-14
python-version: "3.10"
- os: macos-14
python-version: "3.11"
- os: macos-14
python-version: "3.13"
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
- name: Install Rust toolchain
uses: dtolnay/rust-toolchain@stable
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Cache cargo
uses: actions/cache@v4
with:
path: |
~/.cargo/bin
~/.cargo/registry/index
~/.cargo/registry/cache
~/.cargo/git/db
target
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
restore-keys: ${{ runner.os }}-cargo-
- name: Build extension (maturin develop)
shell: bash
run: |
python -m pip install --upgrade pip maturin
maturin develop --release
- name: Install test dependencies
shell: bash
run: |
python -m pip install pytest pandas numpy matplotlib seaborn scipy pyarrow rich jinja2
- name: Run tests
run: python -m pytest tests/ -v --tb=short