From 09ba5e9644a9d340adfd6578412fc1fe1af697cf Mon Sep 17 00:00:00 2001 From: S4NKALP Date: Sat, 6 Jun 2026 17:31:31 +0545 Subject: [PATCH] ci: add CodeQL, lint/typecheck/smoke CI, and dependency review - ci.yml: ruff check + format check, pyright typecheck, and import/CLI smoke test on Python 3.10/3.11/3.12/3.13 matrix. Uses uv like the existing pre-commit workflow for consistency. - codeql.yml: weekly + push/PR Python security-and-quality analysis. - dependency-review.yml: fail PRs adding high+ severity CVEs or copyleft licenses that would taint GPL-3.0 (AGPL, SSPL, BUSL). --- .github/workflows/ci.yml | 87 +++++++++++++++++++++++++ .github/workflows/codeql.yml | 49 ++++++++++++++ .github/workflows/dependency-review.yml | 27 ++++++++ 3 files changed, 163 insertions(+) create mode 100644 .github/workflows/ci.yml create mode 100644 .github/workflows/codeql.yml create mode 100644 .github/workflows/dependency-review.yml diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..53b3ef3 --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,87 @@ +name: CI + +on: + push: + branches: [main] + pull_request: + +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + +jobs: + lint: + name: Lint & format + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v6 + + - name: Install uv + uses: astral-sh/setup-uv@v7 + with: + enable-cache: true + cache-dependency-glob: "uv.lock" + + - name: Set up Python + run: uv python install 3.12 + + - name: Sync dependencies + run: uv sync --all-extras --dev + + - name: ruff check + run: uv run ruff check . + + - name: ruff format --check + run: uv run ruff format --check . + + typecheck: + name: Type check (pyright) + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v6 + + - name: Install uv + uses: astral-sh/setup-uv@v7 + with: + enable-cache: true + cache-dependency-glob: "uv.lock" + + - name: Set up Python + run: uv python install 3.12 + + - name: Sync dependencies + run: uv sync --all-extras --dev + + - name: pyright + run: uvx pyright@1.1.396 devgen + + smoke: + name: Import & CLI smoke (${{ matrix.python-version }}) + runs-on: ubuntu-latest + strategy: + fail-fast: false + matrix: + python-version: ["3.10", "3.11", "3.12", "3.13"] + steps: + - uses: actions/checkout@v6 + + - name: Install uv + uses: astral-sh/setup-uv@v7 + with: + enable-cache: true + cache-dependency-glob: "uv.lock" + + - name: Set up Python ${{ matrix.python-version }} + run: uv python install ${{ matrix.python-version }} + + - name: Sync dependencies + run: uv sync --all-extras --dev + + - name: Import devgen + run: uv run python -c "import devgen, devgen.ai, devgen.utils, devgen.cli.main; print('imports OK')" + + - name: CLI --help + run: uv run devgen --help + + - name: CLI commit --help + run: uv run devgen commit --help diff --git a/.github/workflows/codeql.yml b/.github/workflows/codeql.yml new file mode 100644 index 0000000..95d720f --- /dev/null +++ b/.github/workflows/codeql.yml @@ -0,0 +1,49 @@ +name: CodeQL + +on: + push: + branches: [main] + pull_request: + branches: [main] + schedule: + - cron: "17 6 * * 1" + +permissions: + actions: read + contents: read + security-events: write + +jobs: + analyze: + name: Analyze (${{ matrix.language }}) + runs-on: ubuntu-latest + strategy: + fail-fast: false + matrix: + language: [python] + + steps: + - uses: actions/checkout@v6 + + - name: Install uv + uses: astral-sh/setup-uv@v7 + with: + enable-cache: true + cache-dependency-glob: "uv.lock" + + - name: Set up Python + run: uv python install 3.12 + + - name: Sync dependencies + run: uv sync --all-extras --dev + + - name: Initialize CodeQL + uses: github/codeql-action/init@v3 + with: + languages: ${{ matrix.language }} + queries: security-and-quality + + - name: Perform CodeQL Analysis + uses: github/codeql-action/analyze@v3 + with: + category: "/language:${{ matrix.language }}" diff --git a/.github/workflows/dependency-review.yml b/.github/workflows/dependency-review.yml new file mode 100644 index 0000000..2f1f34d --- /dev/null +++ b/.github/workflows/dependency-review.yml @@ -0,0 +1,27 @@ +name: Dependency Review + +on: + pull_request: + branches: [main] + +permissions: + contents: read + pull-requests: write + +jobs: + dependency-review: + name: Audit dependencies + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v6 + + - name: Dependency Review + uses: actions/dependency-review-action@v4 + with: + fail-on-severity: high + fail-on-scopes: changes + license-check: true + # Project is GPL-3.0-or-later; flag licenses that would taint it. + deny-licenses: AGPL-1.0-only, AGPL-1.0-or-later, AGPL-3.0-only, AGPL-3.0-or-later, SSPL-1.0, BUSL-1.1 + comment-summary-in-pr: always + vuln-check-non-vulnerable-refs: true