| 1 |
|
| 2 |
|
| 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 |
|
| 18 |
|
| 19 |
|
| 20 |
|
| 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 |
|
| 30 |
- name: Checkout repository |
| 31 |
uses: actions/checkout@v4 |
| 32 |
with: |
| 33 |
fetch-depth: 1 |
| 34 |
|
| 35 |
|
| 36 |
|
| 37 |
- name: Setup Python Environment & Install Dependencies |
| 38 |
uses: ./.github/actions/setup-python-uv |
| 39 |
with: |
| 40 |
python-version: ${{ inputs.python-version }} |
| 41 |
|
| 42 |
|
| 43 |
- name: Check repository best-practices |
| 44 |
uses: scientific-python/[email protected] |
| 45 |
with: |
| 46 |
plugins: sp-repo-review |
| 47 |
|
| 48 |
|
| 49 |
- name: Run ruff linter |
| 50 |
uses: astral-sh/ruff-action@v3 |
| 51 |
|
| 52 |
|
| 53 |
|
| 54 |
- name: Run ruff formatter (check mode) |
| 55 |
uses: astral-sh/ruff-action@v3 |
| 56 |
with: |
| 57 |
args: 'format --check --diff' |
| 58 |
|
| 59 |
|
| 60 |
|
| 61 |
- name: Build sphinx docs |
| 62 |
run: uvx tox -e docs |
| 63 |
|
| 64 |
|
| 65 |
- name: Typo checking (codespell) |
| 66 |
uses: codespell-project/actions-codespell@v2 |