Files
qBittorrent/.github/workflows/ci_python.yaml
dependabot[bot] 7451552e6a GHA CI: Bump actions version
PR #23566.

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-12-13 14:13:34 +08:00

84 lines
2.2 KiB
YAML

name: CI - Python
on: [pull_request, push]
permissions: {}
concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
cancel-in-progress: ${{ github.head_ref != '' }}
jobs:
ci:
name: Check
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v6
with:
persist-credentials: false
- name: Setup python (auxiliary scripts)
uses: actions/setup-python@v6
with:
python-version: '3' # use default version
- name: Install tools (auxiliary scripts)
run: pip install bandit isort pycodestyle pyflakes
- name: Gather files (auxiliary scripts)
run: |
export "PY_FILES=$(find . -type f -name '*.py' ! -path '*searchengine*' -printf '%p ')"
echo $PY_FILES
echo "PY_FILES=$PY_FILES" >> "$GITHUB_ENV"
- name: Lint code (auxiliary scripts)
run: |
pyflakes $PY_FILES
bandit --skip B101,B314,B405 $PY_FILES
- name: Format code (auxiliary scripts)
run: |
pycodestyle \
--max-line-length=1000 \
--statistics \
$PY_FILES
isort \
--check \
--diff \
$PY_FILES
- name: Build code (auxiliary scripts)
run: |
python -m compileall $PY_FILES
- name: Setup python (search engine)
uses: actions/setup-python@v6
with:
python-version: '3.9'
- name: Install tools (search engine)
working-directory: src/searchengine/nova3
run: |
pip install uv
uv sync
- name: Check typings (search engine)
working-directory: src/searchengine/nova3
run: uv run just check
- name: Lint code (search engine)
working-directory: src/searchengine/nova3
run: uv run just lint
- name: Format code (search engine)
working-directory: src/searchengine/nova3
run: |
uv run just format
git diff --exit-code
- name: Build code (search engine)
working-directory: src/searchengine/nova3
run: uv run just build