Debian Codegraph @

.github/workflows/lint.yml

raw symbols SCIP
1 # .github/workflows/reusable-lint-docs.yml
2 # Callable workflow for linting, documentation building, and repository review.
3
4 name: Reusable Lint and Docs
5
6 on:
7 workflow_call:
8 inputs:
9 python-version:
10 description: 'Python version to use for linting and docs'
11 type: string
12 default: '3.13'
13 os:
14 description: 'Operating system to run on'
15 type: string
16 default: 'ubuntu-latest'
17 # If this workflow needs secrets (e.g., for publishing docs), define them here.
18 # secrets:
19 # SOME_SECRET:
20 # required: true
21
22 jobs:
23 lint_docs_repo_review:
24 name: Linting, Docs Build, and Repo Standards
25 runs-on: ${{ inputs.os }}
26 timeout-minutes: 10
27
28 steps:
29 # Step 1: Checkout repository
30 - name: Checkout repository
31 uses: actions/checkout@v4
32 with:
33 fetch-depth: 1
34
35 # Step 2: Setup Python environment, checkout code, and install dependencies.
36 # This uses the composite action, ensuring consistency with other Python jobs.
37 - name: Setup Python Environment & Install Dependencies
38 uses: ./.github/actions/setup-python-uv
39 with:
40 python-version: ${{ inputs.python-version }}
41
42 # Step 3: Check repository best-practices using Scientific Python's repo-review.
43 - name: Check repository best-practices
44 uses: scientific-python/[email protected]
45 with:
46 plugins: sp-repo-review # Uses standard Scientific Python plugins.
47
48 # Step 4: Run ruff linter.
49 - name: Run ruff linter
50 uses: astral-sh/ruff-action@v3
51 # Default 'check' command is used.
52
53 # Step 5: Run ruff formatter in check mode.
54 - name: Run ruff formatter (check mode)
55 uses: astral-sh/ruff-action@v3
56 with:
57 args: 'format --check --diff'
58
59 # Step 6: Build Sphinx documentation.
60 # Assumes a 'docs' environment is configured in tox.ini (or similar for uvx).
61 - name: Build sphinx docs
62 run: uvx tox -e docs # Ensure your tox.ini or pyproject.toml has a 'docs' env setup for uvx.
63
64 # Step 7: Typo checking using codespell.
65 - name: Typo checking (codespell)
66 uses: codespell-project/actions-codespell@v2