scope #28
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: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Install UV package manager | |
| run: | | |
| curl -LsSf https://astral.sh/uv/install.sh | sh | |
| echo "$HOME/.local/bin" >> $GITHUB_PATH | |
| - name: Cache UV dependencies | |
| uses: actions/cache@v3 | |
| with: | |
| path: | | |
| ~/.cache/uv | |
| .venv | |
| key: ${{ runner.os }}-uv-${{ hashFiles('**/pyproject.toml') }} | |
| restore-keys: | | |
| ${{ runner.os }}-uv- | |
| - name: Run setup script | |
| run: | | |
| chmod +x setup.sh | |
| ./setup.sh | |
| - name: Run code formatting check | |
| run: | | |
| source .venv/bin/activate | |
| uv run black --check ce_mcp/ tests/ | |
| - name: Run type checking with mypy | |
| run: | | |
| source .venv/bin/activate | |
| uv run mypy ce_mcp/ | |
| - name: Run unit tests | |
| run: | | |
| source .venv/bin/activate | |
| .venv/bin/pytest tests/ -m "not integration" -v --tb=short | |
| - name: Run integration tests | |
| run: | | |
| source .venv/bin/activate | |
| .venv/bin/pytest tests/ -m integration -v --tb=short | |
| continue-on-error: true # Integration tests may fail due to external dependencies | |
| - name: Run all tests | |
| run: | | |
| source .venv/bin/activate | |
| .venv/bin/pytest tests/ -v --tb=short | |
| lint-and-format: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Install UV package manager | |
| run: | | |
| curl -LsSf https://astral.sh/uv/install.sh | sh | |
| echo "$HOME/.local/bin" >> $GITHUB_PATH | |
| - name: Install dependencies | |
| run: | | |
| uv venv | |
| source .venv/bin/activate | |
| uv pip install -e ".[dev]" | |
| - name: Check code formatting | |
| run: | | |
| source .venv/bin/activate | |
| uv run black --check --diff ce_mcp/ tests/ | |
| - name: Check import sorting | |
| run: | | |
| source .venv/bin/activate | |
| isort --check-only --diff ce_mcp/ tests/ | |