github: Update Python linter workflow.

This commit is contained in:
iabdalkader 2023-07-05 18:53:12 +02:00
parent ec5b6b534d
commit 6197ca2cc8
2 changed files with 7 additions and 10 deletions

View File

@ -4,12 +4,6 @@
name: '🔎 Python Linter' name: '🔎 Python Linter'
on: on:
push:
branches:
- 'master'
paths:
- 'scripts/libraries/*.py'
pull_request: pull_request:
types: types:
- opened - opened
@ -18,11 +12,11 @@ on:
branches: branches:
- 'master' - 'master'
paths: paths:
- 'scripts/examples/*.py'
- 'scripts/libraries/*.py' - 'scripts/libraries/*.py'
jobs: jobs:
build: build:
runs-on: ubuntu-latest runs-on: ubuntu-latest
strategy: strategy:
fail-fast: false fail-fast: false
@ -36,13 +30,14 @@ jobs:
- name: '🐍 Set up Python ${{ matrix.python-version }}' - name: '🐍 Set up Python ${{ matrix.python-version }}'
uses: actions/setup-python@v4 uses: actions/setup-python@v4
with: with:
cache: 'pip'
python-version: ${{ matrix.python-version }} python-version: ${{ matrix.python-version }}
- name: '🛠 Install dependencies' - name: '🛠 Install dependencies'
run: | run: |
python -m pip install --upgrade pip pip install -r requirements.txt
python -m pip install flake8 pytest flake8 --version
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi pytest --version
- name: '😾 Lint with flake8' - name: '😾 Lint with flake8'
run: | run: |

2
.github/workflows/requirements.txt vendored Normal file
View File

@ -0,0 +1,2 @@
flake8
pytest