-
Notifications
You must be signed in to change notification settings - Fork 2
115 lines (97 loc) · 3.75 KB
/
Copy pathquality.yml
File metadata and controls
115 lines (97 loc) · 3.75 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
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
name: AutoControl Code Quality
# Static analysis (ruff, bandit) plus the headless pytest suite added in
# rounds 22-30. Decoupled from the existing dev/stable workflows, which
# run legacy standalone test scripts and exist for hardware integration
# coverage on Windows runners.
on:
push:
branches: [ "dev", "main", "stable" ]
pull_request:
branches: [ "dev", "main", "stable" ]
workflow_dispatch:
permissions:
contents: read
jobs:
dependency-review:
if: github.event_name == 'pull_request'
runs-on: ubuntu-latest
permissions:
contents: read
steps:
- uses: actions/checkout@v4
- uses: actions/dependency-review-action@v4
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.12"
cache: "pip"
- name: Install ruff
run: "pip install --only-binary :all: ruff==0.15.22"
- name: Run ruff
run: ruff check je_auto_control/
security:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.12"
cache: "pip"
- name: Install bandit
run: "pip install --only-binary :all: bandit==1.9.4"
- name: Run bandit (recursive, skip tests + i18n dicts)
run: bandit -r je_auto_control/ -c pyproject.toml
pytest-headless:
runs-on: windows-2022
strategy:
fail-fast: false
matrix:
python-version: [ "3.10", "3.11", "3.12", "3.13", "3.14" ]
steps:
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
cache: "pip"
- name: Install dependencies
run: |
python -m pip install --upgrade pip wheel
# Install the editable package FIRST so its source dir is the
# one Python sees on subsequent imports. We deliberately
# avoid `pip install -r dev_requirements.txt` here because
# that file pulls in `je_auto_control_dev` (a separate PyPI
# package), which ships its own snapshot of `je_auto_control/`
# straight into site-packages and masks the editable install
# for any sub-package the snapshot doesn't include
# (admin, usb, remote_desktop, vision, …).
pip install -e .
pip install --only-binary :all: ruff==0.15.22 bandit==1.9.4 pytest==9.1.1 pytest-timeout==2.4.0 pytest-rerunfailures==15.1 pytest-cov==7.0.0 PySide6==6.11.1
# Paths come from `testpaths` in pyproject.toml. Do NOT pass an explicit
# path here: an argument overrides testpaths, which previously meant the
# flow_control tests were configured to run but silently never did.
- name: Run headless pytest suite
run: >-
pytest -v --tb=short --timeout=120
--cov=je_auto_control --cov-report=term-missing
--cov-report=xml --cov-fail-under=35
- name: Upload coverage report
uses: actions/upload-artifact@v4
with:
name: coverage-${{ matrix.python-version }}
path: coverage.xml
typing-stable-api:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: "3.12"
- run: pip install -e . # NOSONAR githubactions:S8541,githubactions:S8544 # reason: installs the checked-out project itself, there is no upstream version to lock and the build must run
- run: "pip install --only-binary :all: mypy==2.3.0"
- run: mypy je_auto_control/api je_auto_control/utils/failure_bundle