Skip to content

Latest commit

 

History

History
 
 
name: README

# Executable coverage for README.md.
#
# Fails when the Rust server configuration in the README is malformed. The
# exercise lives in tests/readme/ so it reproduces locally with
# `uv run pytest tests/readme -v`.

on:
  pull_request:
    paths:
      - "README.md"
      - "Cargo.toml"
      - "crates/switchyard-server/**"
      - "tests/readme/**"
      - "pyproject.toml"
      - "uv.lock"
      - ".github/workflows/readme.yml"
  push:
    branches: [main]
    paths:
      - "README.md"
      - "Cargo.toml"
      - "crates/switchyard-server/**"
      - "tests/readme/**"
      - "pyproject.toml"
      - "uv.lock"
      - ".github/workflows/readme.yml"

concurrency:
  group: ${{ github.workflow }}-${{ github.ref }}
  cancel-in-progress: ${{ github.event_name == 'pull_request' }}

permissions:
  contents: read

jobs:
  readme:
    name: Run README flow
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
      - uses: astral-sh/setup-uv@v6
        with:
          python-version: "3.12"
          enable-cache: true
          cache-dependency-glob: "uv.lock"
      - name: Install
        run: uv sync --locked
      - name: Exercise the README
        run: uv run pytest tests/readme -v
        # Legacy Python README execution:
        # run: uv run pytest tests/readme --markdown-docs README.md -v
        # env:
        #   OPENAI_API_KEY: sk-test
        #   NVIDIA_API_KEY: nvapi-test
        #   ANTHROPIC_API_KEY: sk-ant-test