# .github/workflows/reusable-lint-docs.yml # Callable workflow for linting, documentation building, and repository review. name: Reusable Lint and Docs on: workflow_call: inputs: python-version: description: 'Python version to use for linting and docs' type: string default: '3.13' os: description: 'Operating system to run on' type: string default: 'ubuntu-latest' # If this workflow needs secrets (e.g., for publishing docs), define them here. # secrets: # SOME_SECRET: # required: true jobs: lint_docs_repo_review: name: Linting, Docs Build, and Repo Standards runs-on: ${{ inputs.os }} timeout-minutes: 10 steps: # Step 1: Checkout repository - name: Checkout repository uses: actions/checkout@v4 with: fetch-depth: 1 # Step 2: Setup Python environment, checkout code, and install dependencies. # This uses the composite action, ensuring consistency with other Python jobs. - name: Setup Python Environment & Install Dependencies uses: ./.github/actions/setup-python-uv with: python-version: ${{ inputs.python-version }} # Step 3: Check repository best-practices using Scientific Python's repo-review. - name: Check repository best-practices uses: scientific-python/repo-review@v0.12.2 with: plugins: sp-repo-review # Uses standard Scientific Python plugins. # Step 4: Run ruff linter. - name: Run ruff linter uses: astral-sh/ruff-action@v3 # Default 'check' command is used. # Step 5: Run ruff formatter in check mode. - name: Run ruff formatter (check mode) uses: astral-sh/ruff-action@v3 with: args: 'format --check --diff' # Step 6: Build Sphinx documentation. # Assumes a 'docs' environment is configured in tox.ini (or similar for uvx). - name: Build sphinx docs run: uvx tox -e docs # Ensure your tox.ini or pyproject.toml has a 'docs' env setup for uvx. # Step 7: Typo checking using codespell. - name: Typo checking (codespell) uses: codespell-project/actions-codespell@v2