@@ -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,184 +18,79 @@ 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 Plugins_SDK engine_sdk bcasl
45-
46- - name : Bandit (security)
47- run : bandit -r utils Plugins_SDK engine_sdk bcasl -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
21+ python-version : " 3.13"
22+ cache : " pip"
7223
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 .
91-
92- types :
93- name : Type checking
94- runs-on : ubuntu-latest
95- steps :
96- - name : Checkout repository
97- uses : actions/checkout@v4
98-
99- - name : Set up Python
100- uses : actions/setup-python@v5
101- with :
102- python-version : ${{ env.PYTHON_VERSION }}
103- cache : ' pip'
104-
105- - name : Install dependencies
24+ - name : Install tooling
10625 run : |
10726 python -m pip install --upgrade pip
108- if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
109- pip install mypy
27+ pip install ruff black
11028
111- - name : MyPy type check
112- run : mypy --config-file pyproject.toml utils Plugins_SDK engine_sdk bcasl
29+ - name : Ruff
30+ run : ruff check .
31+
32+ - name : Black
33+ run : black --check .
11334
11435 tests :
115- name : Tests
116- runs-on : ubuntu-latest
117- env :
118- QT_QPA_PLATFORM : offscreen
36+ name : Tests (${{ matrix.os }}, py${{ matrix.python-version }})
37+ runs-on : ${{ matrix.os }}
11938 strategy :
39+ fail-fast : false
12040 matrix :
121- python-version : ['3.10', '3.11', '3.12']
41+ os : [ubuntu-latest, windows-latest]
42+ python-version : ["3.12", "3.13"]
43+ env :
44+ QT_QPA_PLATFORM : offscreen
12245 steps :
12346 - name : Checkout repository
12447 uses : actions/checkout@v4
12548
126- - name : Set up Python ${{ matrix.python-version }}
49+ - name : Set up Python
12750 uses : actions/setup-python@v5
12851 with :
12952 python-version : ${{ matrix.python-version }}
130- cache : ' pip'
53+ cache : " pip"
13154
13255 - name : Install dependencies
13356 run : |
13457 python -m pip install --upgrade pip
135- if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
58+ pip install -r requirements.txt
13659
137- - name : Run tests with pytest
138- run : |
139- if [ -d tests ]; then
140- python -m pytest tests/ -v --tb=short --cov=utils --cov=Plugins_SDK --cov=engine_sdk --cov=bcasl --cov-report=xml --cov-report=term-missing
141- else
142- echo "No tests directory found, skipping tests"
143- fi
60+ - name : Run unit tests
61+ run : pytest -q
14462
145- - name : Upload coverage to Codecov
146- if : matrix.python-version == '3.11'
147- uses : codecov/codecov-action@v4
148- with :
149- file : ./coverage.xml
150- flags : unittests
151- name : codecov-umbrella
152- fail_ci_if_error : false
153-
154- build :
155- name : Build and test (${{ matrix.os }}, py${{ matrix.python-version }})
63+ smoke :
64+ name : Smoke checks (${{ matrix.os }})
15665 runs-on : ${{ matrix.os }}
157- needs : lint
158- env :
159- QT_QPA_PLATFORM : offscreen
66+ needs : [lint, tests]
16067 strategy :
16168 fail-fast : false
16269 matrix :
163- os : [ubuntu-latest, macos-latest, windows-latest]
164- python-version : ['3.10', '3.11']
165-
70+ os : [ubuntu-latest, windows-latest]
71+ env :
72+ QT_QPA_PLATFORM : offscreen
16673 steps :
16774 - name : Checkout repository
16875 uses : actions/checkout@v4
16976
17077 - name : Set up Python
17178 uses : actions/setup-python@v5
17279 with :
173- python-version : ${{ matrix.python-version }}
174- cache : ' pip'
175-
176- - name : Upgrade pip
177- run : python -m pip install --upgrade pip
80+ python-version : " 3.13"
81+ cache : " pip"
17882
179- - name : Install requirements (if present)
180- if : hashFiles('requirements.txt') != ''
181- run : python -m pip install -r requirements.txt
182-
183- - name : Install tooling (pytest, coverage, build)
184- run : python -m pip install pytest coverage build
83+ - name : Install dependencies
84+ run : |
85+ python -m pip install --upgrade pip
86+ pip install -r requirements.txt
18587
186- - name : Verify sources compile
88+ - name : Compile sources
18789 run : python -m compileall -q .
18890
189- - name : Run tests with coverage (if tests/ exists)
190- run : >-
191- 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"
192-
193- - name : Generate coverage XML (if coverage file exists)
194- run : >-
195- python -c "import os,sys,subprocess; sys.exit(subprocess.call([sys.executable,'-m','coverage','xml','-i'])) if os.path.isfile('.coverage') else 0"
196-
197- - name : Upload coverage artifact
198- uses : actions/upload-artifact@v4
199- with :
200- name : coverage-${{ matrix.os }}-py${{ matrix.python-version }}
201- path : coverage.xml
202- if-no-files-found : ignore
203-
204- # Packaging (sdist/wheel) intentionally disabled.
205- # This project is distributed as a standalone binary, not a PyPI package.
91+ - name : CLI smoke
92+ run : |
93+ python pycompiler_ark.py --help
94+ python pycompiler_ark.py --help-all
95+ python pycompiler_ark.py --version
96+ python pycompiler_ark.py --info
0 commit comments