Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
83 changes: 83 additions & 0 deletions .github/workflows/python-ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
name: Python CI

on:
push:
branches: [main, "copilot/**"]
paths:
- "python_host/**"
- ".github/workflows/python-ci.yml"
pull_request:
branches: [main]
paths:
- "python_host/**"
- ".github/workflows/python-ci.yml"

permissions:
contents: read

jobs:
test-core:
name: Core Tests (no ML)
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.10", "3.11", "3.12"]

steps:
- uses: actions/checkout@v4

- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}

- name: Install core dependencies
run: |
python -m pip install --upgrade pip
pip install -r python_host/requirements.txt
pip install pytest

- name: Run core tests
run: |
python -m pytest python_host/tests/ -v --tb=short

test-ml:
name: ML Integration Tests
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4

- name: Set up Python 3.11
uses: actions/setup-python@v5
with:
python-version: "3.11"

- name: Install all dependencies (core + ML)
run: |
python -m pip install --upgrade pip
pip install -r python_host/requirements-ml.txt
pip install pytest

- name: Run all tests
run: |
python -m pytest python_host/tests/ -v --tb=short

lint:
name: Lint
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4

- name: Set up Python 3.11
uses: actions/setup-python@v5
with:
python-version: "3.11"

- name: Install linter
run: pip install flake8

- name: Run flake8
run: |
flake8 python_host/ --max-line-length=120 --ignore=E402,W503,E501
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ htmlcov/
pid_log.csv
*.mp4
*.avi
python_host/data/

# Arduino
*.hex
Expand Down
Loading
Loading