@@ -2,18 +2,14 @@ name: CI
22
33on :
44 push :
5- branches : [ main, develop ]
5+ branches : [main, develop]
66 pull_request :
7- branches : [ main, develop ]
7+ branches : [main, develop]
88 workflow_dispatch :
99
10- env :
11- PYTHON_VERSION : ' 3.11'
12- CACHE_VERSION : v1
13-
1410jobs :
1511 lint :
16- name : Lint and static analysis
12+ name : Lint (ruff + black)
1713 runs-on : ubuntu-latest
1814 steps :
1915 - name : Checkout repository
@@ -22,75 +18,34 @@ jobs:
2218 - name : Set up Python
2319 uses : actions/setup-python@v5
2420 with :
25- python-version : ${{ env.PYTHON_VERSION }}
26- cache : ' pip'
27- cache-dependency-path : |
28- requirements.txt
29- constraints.txt
30-
31- - name : Upgrade pip
32- run : python -m pip install --upgrade pip
33-
34- - name : Install linters and tools
35- run : python -m pip install ruff mypy bandit pip-audit safety cyclonedx-py
36-
37- - name : Ruff (lint)
38- run : ruff check . --output-format=github
39-
40- - name : Ruff (format check)
41- run : ruff format --check .
42-
43- - name : Mypy (type check)
44- run : mypy --config-file pyproject.toml utils API_SDK engine_sdk bcasl acasl
21+ python-version : " 3.13"
22+ cache : " pip"
4523
46- - name : Bandit (security)
47- run : bandit -r utils API_SDK engine_sdk bcasl acasl -f json -o bandit-report.json
48-
49- - name : pip-audit (dependencies)
50- if : hashFiles('requirements.txt') != ''
51- run : pip-audit -r requirements.txt --format=json --output=pip-audit-report.json
52-
53- - name : Safety check
54- if : hashFiles('requirements.txt') != ''
55- run : safety check -r requirements.txt --json --output safety-report.json
56- continue-on-error : true
57-
58- - name : Generate SBOM
59- if : hashFiles('requirements.txt') != ''
60- run : cyclonedx-py -r requirements.txt -o sbom.json
61-
62- - name : Upload security reports
63- uses : actions/upload-artifact@v4
64- with :
65- name : security-reports
66- path : |
67- bandit-report.json
68- pip-audit-report.json
69- safety-report.json
70- sbom.json
71- if-no-files-found : ignore
72-
73- format :
74- name : Code formatting
75- runs-on : ubuntu-latest
76- steps :
77- - name : Checkout repository
78- uses : actions/checkout@v4
79-
80- - name : Set up Python
81- uses : actions/setup-python@v5
82- with :
83- python-version : ${{ env.PYTHON_VERSION }}
84- cache : ' pip'
85-
86- - name : Install black
87- run : python -m pip install black
88-
89- - name : Black format check
90- run : black --check --diff .
24+ - name : Install tooling
25+ run : |
26+ python -m pip install --upgrade pip
27+ pip install ruff black
9128
92- types :
93- name : Type checking
29+ - name : Ruff (progressive scope)
30+ run : |
31+ ruff check \
32+ Core/deps_analyser/analyser.py \
33+ Core/IdeLikeGui/connections.py \
34+ EngineLoader/base.py \
35+ tests/test_engine_install_flow.py \
36+ tests/test_deps_analyser_heuristics.py
37+
38+ - name : Black (progressive scope)
39+ run : |
40+ black --check \
41+ Core/deps_analyser/analyser.py \
42+ Core/IdeLikeGui/connections.py \
43+ EngineLoader/base.py \
44+ tests/test_engine_install_flow.py \
45+ tests/test_deps_analyser_heuristics.py
46+
47+ typecheck :
48+ name : Type check (progressive scope)
9449 runs-on : ubuntu-latest
9550 steps :
9651 - name : Checkout repository
@@ -99,114 +54,86 @@ jobs:
9954 - name : Set up Python
10055 uses : actions/setup-python@v5
10156 with :
102- python-version : ${{ env.PYTHON_VERSION }}
103- cache : ' pip'
57+ python-version : " 3.13 "
58+ cache : " pip"
10459
105- - name : Install dependencies
60+ - name : Install typing tool
10661 run : |
10762 python -m pip install --upgrade pip
108- if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
10963 pip install mypy
11064
111- - name : MyPy type check
112- run : mypy --config-file pyproject.toml utils API_SDK engine_sdk bcasl acasl
65+ - name : Mypy (progressive scope)
66+ run : |
67+ mypy \
68+ --ignore-missing-imports \
69+ --follow-imports skip \
70+ --disable-error-code attr-defined \
71+ --disable-error-code import-untyped \
72+ EngineLoader/base.py \
73+ Core/deps_analyser/analyser.py \
74+ Core/IdeLikeGui/connections.py \
75+ tests/test_engine_install_flow.py \
76+ tests/test_deps_analyser_heuristics.py
11377
11478 tests :
115- name : Tests
116- runs-on : ubuntu-latest
79+ name : Tests (${{ matrix.os }}, py${{ matrix.python-version }})
80+ runs-on : ${{ matrix.os }}
11781 strategy :
82+ fail-fast : false
11883 matrix :
119- python-version : ['3.10', '3.11', '3.12']
84+ os : [ubuntu-latest, windows-latest]
85+ python-version : ["3.12", "3.13"]
86+ env :
87+ QT_QPA_PLATFORM : offscreen
12088 steps :
12189 - name : Checkout repository
12290 uses : actions/checkout@v4
12391
124- - name : Set up Python ${{ matrix.python-version }}
92+ - name : Set up Python
12593 uses : actions/setup-python@v5
12694 with :
12795 python-version : ${{ matrix.python-version }}
128- cache : ' pip'
96+ cache : " pip"
12997
13098 - name : Install dependencies
13199 run : |
132100 python -m pip install --upgrade pip
133- if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
101+ pip install -r requirements.txt
134102
135- - name : Run tests with pytest
136- run : |
137- if [ -d tests ]; then
138- python -m pytest tests/ -v --tb=short --cov=utils --cov=API_SDK --cov=engine_sdk --cov=bcasl --cov=acasl --cov-report=xml --cov-report=term-missing
139- else
140- echo "No tests directory found, skipping tests"
141- fi
142-
143- - name : Upload coverage to Codecov
144- if : matrix.python-version == '3.11'
145- uses : codecov/codecov-action@v4
146- with :
147- file : ./coverage.xml
148- flags : unittests
149- name : codecov-umbrella
150- fail_ci_if_error : false
103+ - name : Run unit tests
104+ run : pytest -q
151105
152- build :
153- name : Build and test (${{ matrix.os }}, py${{ matrix.python-version }})
106+ smoke :
107+ name : Smoke checks (${{ matrix.os }})
154108 runs-on : ${{ matrix.os }}
155- needs : lint
109+ needs : [ lint, typecheck, tests]
156110 strategy :
157111 fail-fast : false
158112 matrix :
159- os : [ubuntu-latest, macos-latest, windows-latest]
160- python-version : ['3.10', '3.11']
161-
113+ os : [ubuntu-latest, windows-latest]
114+ env :
115+ QT_QPA_PLATFORM : offscreen
162116 steps :
163117 - name : Checkout repository
164118 uses : actions/checkout@v4
165119
166120 - name : Set up Python
167121 uses : actions/setup-python@v5
168122 with :
169- python-version : ${{ matrix.python-version }}
170- cache : ' pip'
171-
172- - name : Upgrade pip
173- run : python -m pip install --upgrade pip
174-
175- - name : Install requirements (if present)
176- if : hashFiles('requirements.txt') != ''
177- run : python -m pip install -r requirements.txt
123+ python-version : " 3.13"
124+ cache : " pip"
178125
179- - name : Install tooling (pytest, coverage, build)
180- run : python -m pip install pytest coverage build
126+ - name : Install dependencies
127+ run : |
128+ python -m pip install --upgrade pip
129+ pip install -r requirements.txt
181130
182- - name : Verify sources compile
131+ - name : Compile sources
183132 run : python -m compileall -q .
184133
185- - name : Run tests with coverage (if tests/ exists)
186- run : >-
187- python -c "import os,sys,subprocess; sys.exit(subprocess.call([sys.executable,'-m','coverage','run','-m','pytest','-q'])) if os.path.isdir('tests') else 0"
188-
189- - name : Generate coverage XML (if coverage file exists)
190- run : >-
191- python -c "import os,sys,subprocess; sys.exit(subprocess.call([sys.executable,'-m','coverage','xml','-i'])) if os.path.isfile('.coverage') else 0"
192-
193- - name : Upload coverage artifact
194- uses : actions/upload-artifact@v4
195- with :
196- name : coverage-${{ matrix.os }}-py${{ matrix.python-version }}
197- path : coverage.xml
198- if-no-files-found : ignore
199-
200- - name : Build distributions (sdist+wheel) if packaging configured
201- if : >-
202- hashFiles('pyproject.toml') != '' ||
203- hashFiles('setup.cfg') != '' ||
204- hashFiles('setup.py') != ''
205- run : python -m build --sdist --wheel
206-
207- - name : Upload dist artifacts (if any)
208- uses : actions/upload-artifact@v4
209- with :
210- name : dist-${{ matrix.os }}-py${{ matrix.python-version }}
211- path : dist/*
212- if-no-files-found : warn
134+ - name : CLI smoke
135+ run : |
136+ python pycompiler_ark.py --help
137+ python pycompiler_ark.py --help-all
138+ python pycompiler_ark.py --version
139+ python pycompiler_ark.py --info
0 commit comments