Files
SuperClaude/.github/workflows/test.yml
mithun50 43bfa0aa02 fix: add --system flag to uv pip install in workflows
Added --system flag to all uv pip install commands to fix
"No virtual environment found" error in GitHub Actions CI/CD.

UV requires either a virtual environment or the --system flag
in CI/CD environments.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-12 18:09:37 +01:00

174 lines
4.5 KiB
YAML

name: Tests
on:
push:
branches: [master, integration]
pull_request:
branches: [master, integration]
workflow_dispatch:
jobs:
test:
name: Test on Python ${{ matrix.python-version }}
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
python-version: ["3.10", "3.11", "3.12"]
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Install UV
run: |
curl -LsSf https://astral.sh/uv/install.sh | sh
echo "$HOME/.cargo/bin" >> $GITHUB_PATH
- name: Verify UV installation
run: uv --version
- name: Install dependencies
run: |
uv pip install --system -e ".[dev]"
- name: Verify package installation
run: |
uv run python -c "import superclaude; print(f'SuperClaude {superclaude.__version__} installed')"
- name: Run tests
run: |
uv run pytest -v --tb=short --color=yes
- name: Run tests with coverage
if: matrix.python-version == '3.10'
run: |
uv run pytest --cov=superclaude --cov-report=xml --cov-report=term
- name: Upload coverage to Codecov
if: matrix.python-version == '3.10'
uses: codecov/codecov-action@v4
with:
file: ./coverage.xml
flags: unittests
name: codecov-umbrella
fail_ci_if_error: false
lint:
name: Lint and Format Check
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.10"
- name: Install UV
run: |
curl -LsSf https://astral.sh/uv/install.sh | sh
echo "$HOME/.cargo/bin" >> $GITHUB_PATH
- name: Install dependencies
run: |
uv pip install --system -e ".[dev]"
- name: Run ruff linter
run: |
uv run ruff check src/ tests/
- name: Check ruff formatting
run: |
uv run ruff format --check src/ tests/
plugin-check:
name: Pytest Plugin Check
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.10"
- name: Install UV
run: |
curl -LsSf https://astral.sh/uv/install.sh | sh
echo "$HOME/.cargo/bin" >> $GITHUB_PATH
- name: Install dependencies
run: |
uv pip install --system -e ".[dev]"
- name: Verify pytest plugin loaded
run: |
uv run pytest --trace-config 2>&1 | grep -q "superclaude" && echo "✅ Plugin loaded successfully" || (echo "❌ Plugin not loaded" && exit 1)
- name: Check available fixtures
run: |
uv run pytest --fixtures | grep -E "(confidence_checker|self_check_protocol|reflexion_pattern|token_budget|pm_context)"
doctor-check:
name: SuperClaude Doctor Check
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.10"
- name: Install UV
run: |
curl -LsSf https://astral.sh/uv/install.sh | sh
echo "$HOME/.cargo/bin" >> $GITHUB_PATH
- name: Install dependencies
run: |
uv pip install --system -e ".[dev]"
- name: Run doctor command
run: |
uv run superclaude doctor --verbose
test-summary:
name: Test Summary
runs-on: ubuntu-latest
needs: [test, lint, plugin-check, doctor-check]
if: always()
steps:
- name: Check test results
run: |
if [ "${{ needs.test.result }}" != "success" ]; then
echo "❌ Tests failed"
exit 1
fi
if [ "${{ needs.lint.result }}" != "success" ]; then
echo "❌ Linting failed"
exit 1
fi
if [ "${{ needs.plugin-check.result }}" != "success" ]; then
echo "❌ Plugin check failed"
exit 1
fi
if [ "${{ needs.doctor-check.result }}" != "success" ]; then
echo "❌ Doctor check failed"
exit 1
fi
echo "✅ All checks passed!"