docs: enhance README structure and add workflow improvements #59
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: Run tests and linting | |
| on: | |
| # Avoid duplicate runs: run on PRs for branches, and on direct pushes to main | |
| # but ignore changes to pyproject.toml, CHANGELOG.md, and uv.lock | |
| # This is to avoid running tests and linting for commits that only relate to releases | |
| push: | |
| branches: ["main"] | |
| paths-ignore: | |
| - "pyproject.toml" | |
| - "CHANGELOG.md" | |
| - "uv.lock" | |
| pull_request: | |
| jobs: | |
| test: | |
| name: Test (uv + pytest) | |
| runs-on: ubuntu-latest | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| python: ["3.12"] | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Install uv (with cache) | |
| uses: astral-sh/setup-uv@v6 | |
| with: | |
| enable-cache: true | |
| cache-dependency-glob: | | |
| **/pyproject.toml | |
| **/uv.lock | |
| - name: Install Python | |
| run: uv python install ${{ matrix.python }} | |
| - name: Sync dependencies (frozen) | |
| run: uv sync --all-groups --frozen | |
| - name: Run tests with coverage | |
| run: uv run pytest -vv --cov=mcp_server --cov-report=term-missing:skip-covered --cov-report=xml | |
| - name: Upload coverage.xml artifact | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: coverage-xml-${{ matrix.python }} | |
| path: coverage.xml | |
| - name: Upload coverage to Codecov | |
| uses: codecov/codecov-action@v4 | |
| with: | |
| files: coverage.xml | |
| flags: unittests | |
| fail_ci_if_error: false | |
| lint: | |
| name: Lint (uv + ruff) | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Install uv (with cache) | |
| uses: astral-sh/setup-uv@v6 | |
| with: | |
| enable-cache: true | |
| cache-dependency-glob: | | |
| **/pyproject.toml | |
| **/uv.lock | |
| - name: Install Python | |
| run: uv python install 3.12 | |
| - name: Sync dependencies (frozen) | |
| run: uv sync --all-groups --frozen | |
| - name: Run ruff lint | |
| run: uv run ruff check . | |
| - name: Format (check) | |
| run: uv run ruff format --check . | |
| - name: Pre-commit (meta checks) | |
| run: uv run pre-commit run --all-files --show-diff-on-failure |