Skip to content

Commit 5aae2f5

Browse files
committed
ci(pylint): install project dependencies and enable pip cache
1 parent 4108292 commit 5aae2f5

1 file changed

Lines changed: 27 additions & 13 deletions

File tree

‎.github/workflows/pylint.yml‎

Lines changed: 27 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,37 @@
11
name: Pylint
22

3-
on: [push]
3+
on:
4+
push:
5+
pull_request:
46

57
jobs:
68
build:
79
runs-on: ubuntu-latest
10+
811
strategy:
912
matrix:
1013
python-version: ["3.10", "3.11", "3.12", "3.13"]
14+
1115
steps:
12-
- uses: actions/checkout@v7
13-
- name: Set up Python ${{ matrix.python-version }}
14-
uses: actions/setup-python@v7
15-
with:
16-
python-version: ${{ matrix.python-version }}
17-
- name: Install dependencies
18-
run: |
19-
python -m pip install --upgrade pip
20-
pip install pylint
21-
- name: Analysing the code with pylint
22-
run: |
23-
pylint $(git ls-files '*.py')
16+
- uses: actions/checkout@v7
17+
18+
- uses: actions/setup-python@v7
19+
with:
20+
python-version: ${{ matrix.python-version }}
21+
cache: pip
22+
cache-dependency-path: requirements.txt
23+
24+
- name: Install dependencies
25+
run: |
26+
python -m pip install --upgrade pip
27+
pip install pylint
28+
pip install -r requirements.txt
29+
30+
- name: Run pylint
31+
run: |
32+
FILES=$(git ls-files '*.py')
33+
if [ -n "$FILES" ]; then
34+
pylint $FILES
35+
else
36+
echo "No Python files found."
37+
fi

0 commit comments

Comments
 (0)