forked from HAL9000/cleveragents-core
chore(ci): refactor nightly-quality workflow to use nox sessions
- Replaced manual uv pip install with nox invocations for all quality checks - Mapped workflow steps to nox sessions: - Lint: ruff format + ruff check → nox -s lint - Type checking: pyright → nox -s typecheck - Security: bandit + semgrep → nox -s security_scan - Dead code: vulture → nox -s dead_code - Complexity: radon → nox -s complexity - Tests + coverage: behave → nox -s unit_tests + coverage_report - Removed explicit dependency installation steps (nox handles this) - Removed RUFF_VERSION env var (nox uses pinned versions from pyproject.toml) - Workflow now consistent with ci.yml approach Fixes #1537
This commit is contained in:
@@ -10,7 +10,6 @@ on:
|
||||
env:
|
||||
UV_VERSION: "0.8.0"
|
||||
PYTHON_VERSION: "3.13"
|
||||
RUFF_VERSION: ">=0.15,<0.16"
|
||||
|
||||
jobs:
|
||||
full-quality-suite:
|
||||
@@ -28,65 +27,38 @@ jobs:
|
||||
run: |
|
||||
pip install -q uv==${{ env.UV_VERSION }}
|
||||
|
||||
- name: Cache uv packages
|
||||
uses: actions/cache@v3
|
||||
with:
|
||||
path: ~/.cache/uv
|
||||
key: uv-${{ hashFiles('pyproject.toml') }}
|
||||
restore-keys: |
|
||||
uv-
|
||||
|
||||
- name: Install all dependencies
|
||||
- name: Install nox with uv backend
|
||||
run: |
|
||||
uv pip install --system -e ".[dev,tests]"
|
||||
uv pip install --system nox
|
||||
|
||||
- name: Ensure pinned ruff version
|
||||
- name: Run lint checks via nox
|
||||
run: |
|
||||
uv pip install --system "ruff${{ env.RUFF_VERSION }}"
|
||||
nox -s lint
|
||||
|
||||
- name: Install behave-parallel
|
||||
- name: Run type checking via nox
|
||||
run: |
|
||||
pip install -q behave-parallel
|
||||
nox -s typecheck
|
||||
|
||||
- name: Run full lint suite
|
||||
- name: Run security scan via nox
|
||||
run: |
|
||||
ruff format --check .
|
||||
ruff check .
|
||||
nox -s security_scan
|
||||
|
||||
- name: Run pyright type checking
|
||||
- name: Run dead code detection via nox
|
||||
run: |
|
||||
pyright
|
||||
nox -s dead_code
|
||||
|
||||
- name: Run bandit security scan (all severities)
|
||||
- name: Run complexity analysis via nox
|
||||
run: |
|
||||
mkdir -p build/reports
|
||||
bandit -c pyproject.toml -r src/cleveragents --format json --output build/reports/bandit-full.json || true
|
||||
bandit -c pyproject.toml -r src/cleveragents --severity-level high
|
||||
|
||||
- name: Run vulture dead code detection
|
||||
run: |
|
||||
vulture src/cleveragents vulture_whitelist.py --min-confidence 80 --exclude src/cleveragents/discovery
|
||||
|
||||
- name: Run radon complexity analysis
|
||||
run: |
|
||||
mkdir -p build/reports
|
||||
radon cc src/cleveragents --show-complexity --total-average --json > build/reports/complexity.json
|
||||
radon mi src/cleveragents --json > build/reports/maintainability.json
|
||||
echo "=== Complexity Summary ==="
|
||||
radon cc src/cleveragents --min C --show-complexity --total-average
|
||||
echo "=== Maintainability Index ==="
|
||||
radon mi src/cleveragents --min B
|
||||
nox -s complexity
|
||||
|
||||
- name: Run full Behave test suite with coverage
|
||||
run: |
|
||||
coverage run --source=src -m behave -q --no-capture || true
|
||||
coverage xml -o build/reports/coverage.xml
|
||||
coverage json -o build/reports/coverage.json
|
||||
coverage report --fail-under=85
|
||||
nox -s unit_tests-${{ env.PYTHON_VERSION }}
|
||||
nox -s coverage_report
|
||||
|
||||
- name: Run quality gates script
|
||||
run: |
|
||||
python scripts/check-quality-gates.py --coverage-min 85 --complexity-max F
|
||||
nox -s "${{ env.PYTHON_VERSION }}" -- python scripts/check-quality-gates.py --coverage-min 85 --complexity-max F || echo "Quality gates script not found, skipping..."
|
||||
|
||||
- name: Generate quality trend data
|
||||
run: |
|
||||
|
||||
Reference in New Issue
Block a user