name: Tests on: push: branches: [ main, development ] pull_request: branches: [ main, development ] jobs: lint: name: Code Quality (Ruff & Mypy) runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - name: Set up Python 3.12 uses: actions/setup-python@v5 with: python-version: '3.12' - name: Install dependencies run: | python -m pip install --upgrade pip pip install "ruff==0.15.8" mypy pip install -e . - name: Run ruff linter run: ruff check src/ tests/ --output-format=github - name: Run ruff formatter check run: ruff format --check src/ tests/ - name: Run mypy type checker run: mypy src/skill_seekers --show-error-codes --pretty continue-on-error: true test-fast: name: Fast Unit Tests (parallel) runs-on: ${{ matrix.os }} strategy: fail-fast: false matrix: os: [ubuntu-latest, macos-latest] python-version: ['3.10', '3.11', '3.12'] exclude: - os: macos-latest python-version: '3.10' steps: - uses: actions/checkout@v4 with: submodules: recursive - name: Set up Python ${{ matrix.python-version }} uses: actions/setup-python@v5 with: python-version: ${{ matrix.python-version }} - name: Cache pip packages uses: actions/cache@v4 with: path: ~/.cache/pip key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }} restore-keys: | ${{ runner.os }}-pip- - name: Install dependencies run: | python -m pip install --upgrade pip pip install -r requirements.txt pip install pytest-xdist pytest-timeout pip install -e . - name: Run fast tests (xdist parallel) run: | python -m pytest tests/ -n auto --dist=loadfile \ -m "not slow and not integration and not e2e and not network and not serial and not mcp_only" \ -q --timeout=120 --cov=src/skill_seekers --cov-report=xml --cov-report=term timeout-minutes: 15 - name: Upload coverage to Codecov uses: codecov/codecov-action@v4 with: file: ./coverage.xml flags: unittests name: codecov-umbrella fail_ci_if_error: false test-serial: name: Serial / Integration / E2E Tests runs-on: ubuntu-latest needs: [test-fast] steps: - uses: actions/checkout@v4 with: submodules: recursive - name: Set up Python 3.12 uses: actions/setup-python@v5 with: python-version: '3.12' - name: Install dependencies run: | python -m pip install --upgrade pip pip install -r requirements.txt pip install pytest-timeout pip install -e . - name: Run serial/integration/E2E tests run: | python -m pytest tests/ \ --ignore=tests/test_bootstrap_skill_e2e.py \ --ignore=tests/test_bootstrap_skill.py \ -m "(integration or e2e or slow or network or serial) and not mcp_only" \ -v --timeout=300 timeout-minutes: 25 test-mcp: name: MCP Server Tests runs-on: ubuntu-latest needs: [test-fast] steps: - uses: actions/checkout@v4 with: submodules: recursive - name: Set up Python 3.12 uses: actions/setup-python@v5 with: python-version: '3.12' - name: Install dependencies run: | python -m pip install --upgrade pip pip install -r requirements.txt pip install pytest-timeout pip install -e ".[mcp]" pip install -e . - name: Run MCP tests run: | python -m pytest tests/ \ -m "mcp_only and not network" \ -v --timeout=180 timeout-minutes: 10 tests-complete: name: Tests needs: [lint, test-fast, test-serial, test-mcp] runs-on: ubuntu-latest if: always() steps: - name: Check all results run: | if [ "${{ needs.lint.result }}" != "success" ]; then echo "❌ Code quality checks failed!" exit 1 fi if [ "${{ needs.test-fast.result }}" != "success" ]; then echo "❌ Fast tests failed!" exit 1 fi if [ "${{ needs.test-serial.result }}" == "failure" ]; then echo "❌ Serial/integration tests failed!" exit 1 fi if [ "${{ needs.test-mcp.result }}" == "failure" ]; then echo "❌ MCP tests failed!" exit 1 fi echo "✅ All checks passed!"