WebUI: Apply box-sizing reset
[qBittorrent.git] / .github / workflows / ci_python.yaml
blob268dd1ecf32c18d4eeae55ff502671896ea38559
1 name: CI - Python
3 on: [pull_request, push]
5 permissions: {}
7 concurrency:
8   group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
9   cancel-in-progress: ${{ github.head_ref != '' }}
11 jobs:
12   ci:
13     name: Check
14     runs-on: ubuntu-latest
16     steps:
17       - name: Checkout repository
18         uses: actions/checkout@v4
20       - name: Setup python (auxiliary scripts)
21         uses: actions/setup-python@v5
22         with:
23           python-version: '3'  # use default version
25       - name: Install tools (auxiliary scripts)
26         run: pip install bandit pycodestyle pyflakes
28       - name: Gather files (auxiliary scripts)
29         run: |
30           export "PY_FILES=$(find . -type f -name '*.py' ! -path '*searchengine*' -printf '%p ')"
31           echo $PY_FILES
32           echo "PY_FILES=$PY_FILES" >> "$GITHUB_ENV"
34       - name: Lint code (auxiliary scripts)
35         run: |
36           pyflakes $PY_FILES
37           bandit --skip B314,B405 $PY_FILES
39       - name: Format code (auxiliary scripts)
40         run: |
41           pycodestyle \
42             --max-line-length=1000 \
43             --statistics \
44             $PY_FILES
46       - name: Build code (auxiliary scripts)
47         run: |
48           python -m compileall $PY_FILES
50       - name: Setup python (search engine)
51         uses: actions/setup-python@v5
52         with:
53           python-version: '3.9'
55       - name: Install tools (search engine)
56         run: pip install bandit mypy pycodestyle pyflakes pyright
58       - name: Gather files (search engine)
59         run: |
60           export "PY_FILES=$(find . -type f -name '*.py' -path '*searchengine*' ! -name 'socks.py' -printf '%p ')"
61           echo $PY_FILES
62           echo "PY_FILES=$PY_FILES" >> "$GITHUB_ENV"
64       - name: Check typings  (search engine)
65         run: |
66           MYPYPATH="src/searchengine/nova3" \
67           mypy \
68             --follow-imports skip \
69             --strict \
70             $PY_FILES
71           pyright \
72             $PY_FILES
74       - name: Lint code (search engine)
75         run: |
76           pyflakes $PY_FILES
77           bandit --skip B110,B310,B314,B405 $PY_FILES
79       - name: Format code (search engine)
80         run: |
81           pycodestyle \
82             --ignore=E265,E402 \
83             --max-line-length=1000 \
84             --statistics \
85             $PY_FILES
87       - name: Build code (search engine)
88         run: |
89           python -m compileall $PY_FILES