-
Notifications
You must be signed in to change notification settings - Fork 74
51 lines (48 loc) · 1.73 KB
/
flake8-lint.yml
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
39
40
41
42
43
44
45
46
47
48
49
50
51
name: Flake lint Python
on:
push:
branches:
- main
paths:
#TODO: add all python projects paths below "jans-pycloudlib", "jans-cli-tui", "jans-linux-setup"
- 'demos/jans-tent/**'
pull_request:
branches:
- main
paths:
#TODO: add all python projects paths below "jans-pycloudlib", "jans-cli-tui", "jans-linux-setup"
- 'demos/jans-tent/**'
permissions:
contents: read
jobs:
lint:
runs-on: ubuntu-latest
strategy:
#max-parallel: 1
fail-fast: false
matrix:
#TODO: add all python projects paths below "jans-pycloudlib", "jans-cli-tui", "jans-linux-setup"
python-projects: ["demos/jans-tent"]
steps:
- name: Harden Runner
uses: step-security/harden-runner@a4aa98b93cab29d9b1101a6143fb8bce00e2eac4 # v2.7.1
with:
egress-policy: audit
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
- name: Set up Python 3.8
uses: actions/setup-python@0a5c61591373683505ea898e09a3ea4f39ef2b9c # v5.0.0
with:
python-version: 3.8
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install flake8
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
working-directory: ${{ matrix.python-projects }}
- name: Lint with flake8
run: |
# stop the build if there are Python syntax errors or undefined names
flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
# exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide
flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics
working-directory: ${{ matrix.python-projects }}