-
Notifications
You must be signed in to change notification settings - Fork 0
38 lines (36 loc) · 1.12 KB
/
Copy pathruff.yml
File metadata and controls
38 lines (36 loc) · 1.12 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
---
name: "Ruff Lint and Format"
on: # yamllint disable-line rule:truthy
# Makes it reusable; called by other workflows
workflow_call:
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@v6"
- 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 .