ignore certain minor flag in ci check. #12
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: CI | |
| on: | |
| push: | |
| branches: [ main ] | |
| pull_request: | |
| branches: [ main ] | |
| jobs: | |
| test: | |
| runs-on: ${{ matrix.os }} | |
| strategy: | |
| matrix: | |
| os: [ubuntu-latest, macos-latest, windows-latest] | |
| python-version: ['3.9', '3.12'] # Test minimum and latest versions only | |
| 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 system dependencies (Ubuntu) | |
| if: runner.os == 'Linux' | |
| run: | | |
| sudo apt-get update | |
| sudo apt-get install -y libgl1 libegl1 libxkbcommon-x11-0 libxcb-icccm4 libxcb-image0 libxcb-keysyms1 libxcb-randr0 libxcb-render-util0 libxcb-xinerama0 libxcb-xfixes0 libxcb-shape0 libdbus-1-3 | |
| - name: Install uv | |
| run: pip install uv | |
| - name: Create virtual environment and install dependencies | |
| run: | | |
| uv venv | |
| uv pip install -e . | |
| - name: Run diagnostics | |
| run: uv run python diagnose.py | |
| - name: Check imports (non-GUI modules) | |
| run: | | |
| uv run python -c "from src.util import tokenize_title; print('Utils OK')" | |
| uv run python -c "from src.aggregate import aggregate; print('Aggregate OK')" | |
| uv run python -c "from src.app.controller import AppController; print('Controller OK')" | |
| - name: Check GUI imports (skip on headless) | |
| if: runner.os != 'Linux' | |
| run: uv run python -c "from src.app.mainwindow import MainWindow; print('GUI OK')" | |
| - name: Run unit tests | |
| run: | | |
| uv pip install pytest pytest-cov | |
| uv run pytest tests/ -v --cov=src --cov-report=term-missing | |
| continue-on-error: false | |
| - name: Run linting (ruff) | |
| run: | | |
| uv pip install ruff | |
| uv run ruff check src/ --select E,F,W --ignore E501 | |
| continue-on-error: true | |
| - name: Check code formatting (ruff) | |
| run: | | |
| uv run ruff format --check src/ | |
| continue-on-error: true | |
| - name: Type checking (mypy) | |
| run: | | |
| uv pip install mypy types-PyYAML types-requests | |
| uv run mypy src/ --ignore-missing-imports | |
| continue-on-error: true | |
| - name: Security scanning (bandit) | |
| run: | | |
| uv pip install bandit | |
| uv run bandit -r src/ -f txt --skip B112 | |
| continue-on-error: true | |
| - name: Dependency vulnerability check (safety) | |
| run: | | |
| uv pip install safety | |
| uv run safety check --json | |
| continue-on-error: true | |
| # Summary job that all branch protection rules should depend on | |
| ci-success: | |
| name: CI Success | |
| needs: [test] | |
| runs-on: ubuntu-latest | |
| if: always() | |
| steps: | |
| - name: Check test matrix status | |
| run: | | |
| if [ "${{ needs.test.result }}" != "success" ]; then | |
| echo "One or more test jobs failed" | |
| exit 1 | |
| fi | |
| echo "All CI checks passed successfully!" |