mirror of
https://github.com/NawfalMotii79/PLFM_RADAR.git
synced 2026-05-28 10:41:02 +00:00
The v1-era tb_cross_layer_ft2232h.v cosim TB no longer matches production after the protocol-v2 / opcode dispatch rework (PR-G). Equivalent v2 coverage now lives in the FPGA regression's tb_usb_protocol_v2.v and tb_system_opcodes.v. Removed: - tb_cross_layer_ft2232h.v (716 lines) - Tier 2 (Verilog cosimulation) from test_cross_layer_contract.py - iverilog/vvp tool detection and CI install step in ci-tests.yml Tier 1 (static parser) and Tier 3 (C stub execution) remain. CI no longer needs apt-get install iverilog. contract_parser.py updated to reflect the slimmer two-tier model.
135 lines
4.3 KiB
YAML
135 lines
4.3 KiB
YAML
name: AERIS-10 CI
|
|
|
|
on:
|
|
pull_request:
|
|
branches: [main, develop]
|
|
push:
|
|
branches: [main, develop]
|
|
|
|
jobs:
|
|
# ===========================================================================
|
|
# Python: lint (ruff), syntax check (py_compile), unit tests (pytest)
|
|
# CI structure proposed by hcm444 — uses uv for dependency management
|
|
# ===========================================================================
|
|
python-tests:
|
|
name: Python Lint + Tests
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
|
|
- uses: actions/setup-python@v5
|
|
with:
|
|
python-version: "3.12"
|
|
|
|
- uses: astral-sh/setup-uv@v5
|
|
|
|
- name: Install dependencies
|
|
run: uv sync --group dev
|
|
|
|
- name: Ruff lint (whole repo)
|
|
run: uv run ruff check .
|
|
|
|
- name: Syntax check (py_compile)
|
|
run: |
|
|
uv run python - <<'PY'
|
|
import py_compile
|
|
from pathlib import Path
|
|
|
|
skip = {".git", "__pycache__", ".venv", "venv", "docs"}
|
|
for p in Path(".").rglob("*.py"):
|
|
if skip & set(p.parts):
|
|
continue
|
|
py_compile.compile(str(p), doraise=True)
|
|
PY
|
|
|
|
- name: Unit tests
|
|
run: >
|
|
uv run pytest
|
|
9_Firmware/9_3_GUI/test_GUI_V65_Tk.py
|
|
9_Firmware/9_3_GUI/test_v7.py
|
|
-v --tb=short
|
|
|
|
# ===========================================================================
|
|
# MCU Firmware Unit Tests (20 tests)
|
|
# Bug regression (15) + Gap-3 safety tests (5)
|
|
# ===========================================================================
|
|
mcu-tests:
|
|
name: MCU Firmware Tests
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
|
|
- name: Install build tools
|
|
run: sudo apt-get update && sudo apt-get install -y build-essential
|
|
|
|
- name: Build and run MCU tests
|
|
run: make test
|
|
working-directory: 9_Firmware/9_1_Microcontroller/tests
|
|
|
|
# ===========================================================================
|
|
# FPGA RTL Regression (testbenches + lint + cosim helpers)
|
|
# Python deps (numpy, scipy) come from the dev group in pyproject.toml
|
|
# and are installed via uv so the run_regression.sh cosim and T-6 drift
|
|
# check have everything they need.
|
|
# ===========================================================================
|
|
fpga-regression:
|
|
name: FPGA Regression
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
|
|
- uses: actions/setup-python@v5
|
|
with:
|
|
python-version: "3.12"
|
|
|
|
- uses: astral-sh/setup-uv@v5
|
|
|
|
- name: Install Python cosim deps (numpy + scipy)
|
|
run: uv sync --group dev
|
|
|
|
- name: Install Icarus Verilog
|
|
run: sudo apt-get update && sudo apt-get install -y iverilog
|
|
|
|
- name: Run full FPGA regression
|
|
# uv-managed venv lives at ./.venv; activate so run_regression.sh's
|
|
# plain `python3` resolves to it. Without this the cosim helpers
|
|
# would fall back to the runner's system python (no scipy) and the
|
|
# T-6 drift check would emit [SKIP] instead of running.
|
|
run: |
|
|
source ../../.venv/bin/activate
|
|
bash run_regression.sh
|
|
working-directory: 9_Firmware/9_2_FPGA
|
|
|
|
# ===========================================================================
|
|
# Cross-Layer Contract Tests (Python ↔ Verilog ↔ C)
|
|
# Validates opcode maps, bit widths, packet layouts, and round-trip
|
|
# correctness across FPGA RTL, Python GUI, and STM32 firmware. Runs
|
|
# entirely as Python static parsers + the Tier 3 C stub; the v1-era
|
|
# iverilog cosim TB was retired post-PR-G (equivalent v2 coverage now
|
|
# lives in the FPGA regression's tb_usb_protocol_v2 / tb_system_opcodes).
|
|
# ===========================================================================
|
|
cross-layer-tests:
|
|
name: Cross-Layer Contract Tests
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
|
|
- uses: actions/setup-python@v5
|
|
with:
|
|
python-version: "3.12"
|
|
|
|
- uses: astral-sh/setup-uv@v5
|
|
|
|
- name: Install dependencies
|
|
run: uv sync --group dev
|
|
|
|
- name: Run cross-layer contract tests
|
|
run: >
|
|
uv run pytest
|
|
9_Firmware/tests/cross_layer/test_cross_layer_contract.py
|
|
-v --tb=short
|