Skip to content

Commit 60bb98e

Browse files
authored
Merge branch 'dev' into bugfix-fans-overlap
2 parents a04e87a + 3e3583b commit 60bb98e

File tree

6 files changed

+764
-3
lines changed

6 files changed

+764
-3
lines changed

.github/workflows/dev-ci.yml

Lines changed: 89 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,89 @@
1+
name: dev-test-code
2+
3+
on:
4+
push:
5+
branches:
6+
- dev
7+
paths-ignore:
8+
- "scripts/**"
9+
- "BlocksScreen/lib/ui/**"
10+
- "extras/**"
11+
pull_request:
12+
branches:
13+
- dev
14+
paths-ignore:
15+
- "scripts/**"
16+
- "BlocksScreen/lib/ui/**"
17+
- "extras/**"
18+
jobs:
19+
ci-checks:
20+
runs-on: ubuntu-latest
21+
strategy:
22+
fail-fast: false
23+
matrix:
24+
python-version: ["3.11.2"]
25+
test-type: [ruff, pylint, pytest]
26+
steps:
27+
- name: Checkout repo
28+
uses: actions/checkout@v4
29+
30+
- name: Set up Python ${{ matrix.python-version }}
31+
uses: actions/setup-python@v4
32+
with:
33+
python-version: ${{ matrix.python-version }}
34+
cache: "pip"
35+
- name: Install dependencies
36+
run: |
37+
echo "Installing dependencies"
38+
python -m pip install --upgrade pip
39+
pip install scripts -r scripts/requirements-dev.txt
40+
41+
- name: Run Test ${{ matrix.test-type }}
42+
run: |
43+
echo "Starting test runs"
44+
if [ "${{ matrix.test-type }}" == "ruff" ]; then
45+
echo "Running Formatting Test"
46+
ruff check --output-format=github --target-version=py311 --config=pyproject.toml > ruff-output.txt 2>&1
47+
ruff format --diff --target-version=py311 --config=pyproject.toml >> ruff-output.txt 2>&1
48+
echo "Ruff finished"
49+
fi
50+
if [ "${{ matrix.test-type }}" == "pylint" ]; then
51+
echo "Running Code Test"
52+
pylint -j$(nproc) --recursive=y --rcfile=.pylintrc.dev . > pylint-output.txt 2>&1
53+
echo "Pylint finished"
54+
fi
55+
56+
if [ "${{ matrix.test-type }}" == "pytest" ]; then
57+
if [ -d "tests/" ] && [ "$(ls -A tests/)" ]; then
58+
echo "Running Python unit tests"
59+
pytest tests/'*.py' --doctest-modules --junitxml=junit/test-results.xml --cov=com --conv-report=xml --cov-report=html > pytest-output.txt 2>&1
60+
else
61+
echo "No tests directory no need to proceed with tests"
62+
fi
63+
fi
64+
65+
- name: Upload ruff artifact
66+
if: always() && matrix.test-type == 'ruff'
67+
uses: actions/upload-artifact@v4
68+
with:
69+
name: ruff-results
70+
path: ruff-output.txt
71+
72+
- name: Upload Pylint Artifacts
73+
if: always() && matrix.test-type == 'pylint'
74+
uses: actions/upload-artifact@v4
75+
with:
76+
name: pylint-results
77+
path: pylint-output.txt
78+
79+
- name: Upload Pytest Artifacts
80+
if: always() && matrix.test-type == 'pytest' && hashFiles('pytest-output.txt', 'junit/test-results.xml', 'coverage.xml')
81+
uses: actions/upload-artifact@v4
82+
with:
83+
name: pytest-results
84+
path: |
85+
pytest_output.txt
86+
junit/test-results.xml
87+
coverage.xml
88+
htmlcov/
89+

.pylintrc.dev

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
[MAIN]
2+
fail-under=7
3+
jobs=16
4+
ignore=tests,scripts,ui,extras
5+
ignore-paths=BlocksScreen/lib/ui
6+
py-version=3.11
7+
8+
9+
[FORMAT]
10+
max-line-length=88
11+

scripts/dev-requirements.txt

Lines changed: 0 additions & 2 deletions
This file was deleted.

scripts/requirements-dev.txt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
ruff
2+
pylint
3+
pytest
4+
pytest-cov

scripts/requirements.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ pefile==2023.2.7
77
PyQt6==6.7.1
88
PyQt6-Qt6==6.7.2
99
PyQt6_sip==13.8.0
10-
requests==2.32.3
10+
requests==2.32.4
1111
sdbus==0.12.0
1212
sdbus-networkmanager==2.0.0
1313
typing==3.7.4.3

0 commit comments

Comments
 (0)