From 063383b3a49067126c2d298392a7deef0d899d8a Mon Sep 17 00:00:00 2001 From: NITISH-R-G <225521762+NITISH-R-G@users.noreply.github.com> Date: Sat, 27 Jun 2026 21:56:38 +0000 Subject: [PATCH] chore(ci): Automate GitHub Actions quality gates for openenv, bandit, and jscpd - Added `bandit` and `openenv-core` to the CI installation dependencies. - Integrated `bandit` static analysis to enforce security requirements. - Integrated `openenv validate .` to ensure the core simulation runs correctly. - Pinned `jscpd` to version `4.0.0` and excluded build/dist artifacts to stop false positives on node execution. - Added `PYTHONPATH=.` execution requirement to pytest to ensure packages resolve. Co-authored-by: google-labs-jules[bot] <161369871+google-labs-jules[bot]@users.noreply.github.com> --- .github/workflows/code-quality.yml | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/.github/workflows/code-quality.yml b/.github/workflows/code-quality.yml index 6eeeb32..a87f95c 100644 --- a/.github/workflows/code-quality.yml +++ b/.github/workflows/code-quality.yml @@ -26,7 +26,7 @@ jobs: - name: Install dependencies run: | python -m pip install --upgrade pip - pip install ruff mypy pydantic vulture radon + pip install ruff mypy pydantic vulture radon bandit openenv-core pip install -e ".[dev,demo]" - name: Lint and Format with Ruff @@ -38,6 +38,10 @@ jobs: run: | mypy . + - name: Static Analysis with Bandit + run: | + bandit -r . -c pyproject.toml + - name: Dead Code Detection with Vulture run: | vulture . --min-confidence 80 --exclude .venv,venv,.cursor,web/node_modules @@ -47,9 +51,13 @@ jobs: radon cc . -a -nc radon mi . -nc + - name: OpenEnv validation + run: | + openenv validate . + - name: Pytest validation run: | - python -m pytest tests/ -q --tb=line + PYTHONPATH=. python -m pytest tests/ -q --tb=line frontend-quality: runs-on: ubuntu-latest @@ -87,7 +95,7 @@ jobs: node-version: '24' - name: Install jscpd - run: npm install -g jscpd + run: npm install -g jscpd@4.0.0 - name: Check for duplicate code - run: jscpd . --ignore "**/*.json,**/*.md,**/*.yaml,**/*.yml,**/package-lock.json,**/node_modules/**,**/venv/**,**/.venv/**" --threshold 5 + run: jscpd . --ignore "**/*.json,**/*.md,**/*.yaml,**/*.yml,**/package-lock.json,**/node_modules/**,**/venv/**,**/.venv/**,**/dist/**,**/build/**" --threshold 5