Revamp alerts handling
[qBittorrent.git] / .github / workflows / ci_python.yaml
blobf08b382b4df0a2609ac0fa5caefca34fd7eb0c64
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.7'
55       - name: Install tools (search engine)
56         run: pip install bandit pycodestyle pyflakes
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: Lint code (search engine)
65         run: |
66           pyflakes $PY_FILES
67           bandit --skip B110,B310,B314,B405 $PY_FILES
69       - name: Format code (search engine)
70         run: |
71           pycodestyle \
72             --ignore=E265,E402 \
73             --max-line-length=1000 \
74             --statistics \
75             $PY_FILES
77       - name: Build code (search engine)
78         run: |
79           python -m compileall $PY_FILES