Skip to content

Reusable workflows #340

Reusable workflows

Reusable workflows #340

Workflow file for this run

---

Check failure on line 1 in .github/workflows/ruff.yml

View workflow run for this annotation

GitHub Actions / .github/workflows/ruff.yml

Invalid workflow file

(Line: 7, Col: 5): Unexpected value 'paths'
name: "Ruff Lint and Format"
on:
# Makes it reusable; called by other workflows
workflow_call:
paths:
- '**/*.py'
- 'requirements.txt'
- '.pylintrc'
jobs:
ruff:
runs-on: "ubuntu-latest"
# Adding 'timeout-minutes: 10' would prevent jobs from running
# indefinitely if something goes wrong
timeout-minutes: 10
steps:
- uses: "actions/checkout@v5"
- name: "Set up Python 3.12"
uses: "actions/setup-python@v6"
with:
python-version: "3.12"
- name: "Cache PIP Dependencies"
uses: "actions/cache@v4"
with:
path: ~/.cache/pip
key: |
${{ runner.os }}-pip-${{ matrix.python-version }}-${{ hashFiles('requirements.txt') }}
restore-keys: |
${{ runner.os }}-pip-${{ matrix.python-version }}-
${{ runner.os }}-pip-
- name: "Install Ruff"
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt
- name: "Run Ruff lint"
run: |
ruff check --output-format=github .
- name: "Run Ruff format check"
run: |
ruff format --check .