-
Notifications
You must be signed in to change notification settings - Fork 0
62 lines (49 loc) · 1.89 KB
/
Copy pathpython.yml
File metadata and controls
62 lines (49 loc) · 1.89 KB
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
52
53
54
55
56
57
58
59
60
61
# This workflow will install Python dependencies, run tests and lint with a single version of Python
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-python
# To debug locally https://blog.harshcasper.com/debugging-github-actions-workflows-effectively#heading-running-workflows-locally-using-act
name: Python application
on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]
# permissions:
# contents: read
jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.10", "3.11", "3.12"]
steps:
- uses: actions/checkout@v4
with:
lfs: true
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Install uv
uses: astral-sh/setup-uv@v5
with:
enable-cache: true
cache-dependency-glob: "uv.lock"
- name: Install dependencies
run: uv sync --all-extras --dev
- name: Analysing the code with ruff
if: success() || failure()
run: uv run ruff check --output-format=github src
- name: check typing with mypy
if: success() || failure()
run: uv run mypy src
# bug in pylint with cv2: E1101: Module 'cv2' has no '' member (no-member)
# https://github.com/pylint-dev/pylint/issues/10027
- name: Lint with flake8
if: success() || failure()
# check for Python syntax errors or undefined names; the GitHub editor is 127 chars wide
run: |
uv run flake8 src --count --select=E9,F63,F7,F82 --show-source --statistics --max-line-length 90 --max-doc-length 100
uv run flake8 src --count --max-complexity=10 --max-line-length=127 --statistics --max-line-length 90 --max-doc-length 100
- name: Run tests
if: success() || failure()
run: uv run pytest tests