Add files via upload #5
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Python CI | |
| on: | |
| push: | |
| branches: [ main ] | |
| pull_request: | |
| branches: [ main ] | |
| jobs: | |
| lint: | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: read | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| - name: Set up Python with uv | |
| uses: astral-sh/setup-uv@v2 | |
| with: | |
| uv-version: latest | |
| - name: Create virtual environment | |
| run: uv venv | |
| - name: Install linters | |
| run: | | |
| source .venv/bin/activate | |
| uv pip install black flake8 | |
| - name: Check code formatting with Black | |
| run: | | |
| source .venv/bin/activate | |
| echo "🔍 Checking code formats..." | |
| black . | |
| - name: Lint with flake8 | |
| run: | | |
| source .venv/bin/activate | |
| flake8 . --exclude=venv,.git --max-line-length=88 --ignore=E203,W503 | |
| test: | |
| runs-on: ubuntu-latest | |
| needs: lint | |
| permissions: | |
| contents: read | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| - name: Set up Python with uv | |
| uses: astral-sh/setup-uv@v2 | |
| with: | |
| uv-version: latest | |
| - name: Create virtual environment | |
| run: uv venv | |
| - name: Install dependencies | |
| run: | | |
| source .venv/bin/activate | |
| uv pip install -r requirements.txt | |
| uv pip install pytest | |
| - name: Verify main module imports | |
| run: | | |
| source .venv/bin/activate | |
| python -c "import main; print('✅ Main module imported successfully')" | |
| - name: Setup environment file | |
| run: | | |
| if [ ! -f .env ]; then | |
| cp .env.example .env | |
| echo "✅ Created .env from .env.example" | |
| else | |
| echo "ℹ️ .env already exists, skipping copy" | |
| fi |