-
Notifications
You must be signed in to change notification settings - Fork 9
feat(ci): add Tier 1 testing pipeline — lint, typecheck, test, security #13
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
c9c7b32
d43245e
9f4aba3
b194668
f95c717
b8717a2
791320e
0ecee14
21dc9a7
ae0a389
57cacc0
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
| @@ -0,0 +1,69 @@ | ||||||
| name: CI | ||||||
|
|
||||||
| on: | ||||||
| pull_request: | ||||||
| branches: [main, develop, "release/*"] | ||||||
| push: | ||||||
| branches: [main] | ||||||
|
|
||||||
| permissions: | ||||||
| contents: read | ||||||
|
|
||||||
| jobs: | ||||||
| lint: | ||||||
| name: Lint | ||||||
| runs-on: ${{ vars.RUNNER_LABEL || 'blacksmith-2vcpu-ubuntu-2404' }} | ||||||
| steps: | ||||||
| - uses: actions/checkout@v4 | ||||||
| - uses: actions/setup-python@v5 | ||||||
| with: | ||||||
| python-version: "3.12" | ||||||
| - run: pip install ruff | ||||||
| - run: ruff check . | ||||||
| - run: ruff format --check . | ||||||
|
|
||||||
| typecheck: | ||||||
| name: Type Check | ||||||
| runs-on: ${{ vars.RUNNER_LABEL || 'blacksmith-2vcpu-ubuntu-2404' }} | ||||||
| steps: | ||||||
| - uses: actions/checkout@v4 | ||||||
| - uses: actions/setup-python@v5 | ||||||
| with: | ||||||
| python-version: "3.12" | ||||||
| - run: pip install -e ".[dev]" mypy types-PyYAML | ||||||
|
||||||
| - run: pip install -e ".[dev]" mypy types-PyYAML | |
| - run: pip install -e ".[dev]" |
Copilot
AI
Apr 28, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This step redundantly installs pytest-cov even though it’s already included in the .[dev] extra. Installing only -e ".[dev]" reduces CI time and keeps the dependency set consistent.
| - run: pip install -e ".[dev]" pytest-cov | |
| - run: pip install -e ".[dev]" |
Copilot
AI
Apr 28, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The security job installs -e ".[dev]" before running pip-audit, which means the audit includes dev-only tools (pytest/ruff/mypy/etc.) and can fail due to vulnerabilities unrelated to production/runtime dependencies. If the intent is to gate runtime deps, install only the project/runtime deps for this job (e.g., pip install -e .) or otherwise scope what pip-audit checks.
Copilot
AI
Apr 28, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
pip-audit exits non-zero when vulnerabilities are found, which will fail the entire workflow. The PR description notes the scan currently finds real CVEs tracked separately; if those CVEs aren't being fixed in this PR, consider making the audit step non-blocking for now (e.g., continue-on-error on the audit step/job or temporarily ignoring specific vulnerability IDs) so PRs can still merge while remediation is tracked.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -15,10 +15,28 @@ dependencies = [ | |
| [project.scripts] | ||
| narrator-ai-cli = "narrator_ai.cli:app" | ||
|
|
||
| [project.optional-dependencies] | ||
| dev = [ | ||
| "pytest>=8.0.0", | ||
| "pytest-asyncio>=1.0.0", | ||
| "pytest-cov>=5.0", | ||
| "ruff>=0.4", | ||
| "mypy>=1.10", | ||
| "types-PyYAML>=6.0", | ||
| "bandit>=1.7", | ||
| "pip-audit>=2.7", | ||
| ] | ||
|
|
||
| [dependency-groups] | ||
| dev = [ | ||
| "pytest>=8.0.0", | ||
| "pytest-asyncio>=1.0.0", | ||
| "pytest-cov>=5.0", | ||
| "ruff>=0.4", | ||
| "mypy>=1.10", | ||
| "types-PyYAML>=6.0", | ||
| "bandit>=1.7", | ||
| "pip-audit>=2.7", | ||
| ] | ||
|
Comment on lines
+18
to
40
|
||
|
|
||
| [build-system] | ||
|
|
@@ -31,3 +49,25 @@ packages = ["src/narrator_ai"] | |
| [[tool.uv.index]] | ||
| url = "https://mirrors.aliyun.com/pypi/simple" | ||
| default = true | ||
|
|
||
| [tool.ruff] | ||
| target-version = "py310" | ||
| line-length = 120 | ||
| extend-exclude = ["scripts", "install.py"] | ||
|
|
||
| [tool.ruff.lint] | ||
| select = ["E", "F", "W", "I", "N", "UP", "B", "SIM", "S"] | ||
| ignore = ["S101", "S108", "S603", "S607", "B904", "E501", "UP036"] | ||
|
|
||
| [tool.mypy] | ||
| python_version = "3.10" | ||
| warn_return_any = false | ||
| warn_unused_configs = true | ||
| disallow_untyped_defs = false | ||
|
|
||
| [tool.pytest.ini_options] | ||
| testpaths = ["tests"] | ||
| addopts = "-v --tb=short" | ||
|
|
||
| [tool.bandit] | ||
| exclude_dirs = ["tests"] | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
runs-ondefaults toblacksmith-2vcpu-ubuntu-2404, which is not a standard GitHub-hosted runner label. Unless this repo is guaranteed to have that runner available, the workflow will fail to schedule jobs. Consider defaulting toubuntu-latest(or make the runner label an explicit required variable without a nonstandard fallback).