Skip to content

Commit 296db5c

Browse files
committed
restrict workflow run and cache dependencies for faster reruns
There is no need to do a full installation to use ruff this will make the workflow faster
1 parent 676a2eb commit 296db5c

File tree

1 file changed

+15
-4
lines changed

1 file changed

+15
-4
lines changed

.github/workflows/python-code-quality.yaml

Lines changed: 15 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,23 +3,34 @@ name: Python code quality
33
on:
44
push:
55
branches: [ main ]
6+
paths:
7+
- '**.py'
8+
69
pull_request:
710
branches: [ main ]
11+
paths:
12+
- '**.py'
13+
14+
workflow_dispatch:
15+
16+
permissions:
17+
contents: read
818

919
jobs:
10-
build:
20+
checks-format-and-lint:
1121
runs-on: ubuntu-latest
1222
steps:
1323
- uses: actions/checkout@v4
1424
- name: Set up Python 3
1525
uses: actions/setup-python@v5
1626
with:
1727
python-version: "3.12"
28+
cache: 'pip'
1829
- name: Install dependencies
1930
run: |
20-
python -m pip install --upgrade pip
21-
pip install -r requirements-dev.txt
31+
python3 -m pip install --upgrade pip
32+
python3 -m pip install ruff
2233
- name: Lint with ruff
2334
run: ruff check .
2435
- name: Check formatting with ruff
25-
run: ruff format --check .
36+
run: ruff format . --check

0 commit comments

Comments
 (0)