feat: robust SSH with fallback menu + comprehensive tests

- Add fallback Rich-based menu when Textual fails
- Working chess game via simple terminal UI
- Proper PTY/terminal handling for SSH
- Added pytest test suite:
  - SSH auth tests (no-auth, accept any)
  - Mode selection tests (play/learn/watch)
  - Chess board widget tests
  - Move validation tests
  - Game state detection tests
- CI workflow for GitHub Actions
- Run tests with: pytest tests/ -v
This commit is contained in:
Greg Hendrickson
2026-01-27 18:08:57 +00:00
parent 0e9597020a
commit db1ce55c2c
6 changed files with 566 additions and 63 deletions

View File

@@ -2,55 +2,49 @@ name: CI
on:
push:
branches: [develop, master]
branches: [main, develop]
pull_request:
branches: [develop]
branches: [main, develop]
jobs:
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.11"
- name: Install dependencies
run: |
pip install ruff mypy
pip install -e ".[dev]"
- name: Lint with ruff
run: ruff check src/
- name: Type check with mypy
run: mypy src/ --ignore-missing-imports
test:
runs-on: ubuntu-latest
needs: lint
steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.11"
python-version: "3.12"
- name: Install Stockfish
run: sudo apt-get update && sudo apt-get install -y stockfish
- name: Install system dependencies
run: |
sudo apt-get update
sudo apt-get install -y stockfish
- name: Install dependencies
run: pip install -e ".[dev]"
- name: Install Python dependencies
run: |
python -m pip install --upgrade pip
pip install -e ".[dev]"
- name: Run linter
run: |
ruff check src/ tests/
- name: Run type checker
run: |
mypy src/ --ignore-missing-imports
continue-on-error: true
- name: Run tests
run: pytest tests/ -v --tb=short
run: |
pytest tests/ -v --tb=short
build:
runs-on: ubuntu-latest
needs: test
steps:
- uses: actions/checkout@v4
@@ -58,10 +52,11 @@ jobs:
uses: docker/setup-buildx-action@v3
- name: Build Docker image
uses: docker/build-push-action@v5
uses: docker/build-push-action@v6
with:
context: .
push: false
tags: shellmate:${{ github.sha }}
tags: shellmate:test
platforms: linux/amd64,linux/arm64
cache-from: type=gha
cache-to: type=gha,mode=max