Skip to content

Commit e5c66b3

Browse files
committed
Expand CI quality gates
1 parent e650357 commit e5c66b3

2 files changed

Lines changed: 38 additions & 15 deletions

File tree

.github/workflows/tests.yml

Lines changed: 30 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: Python tests
1+
name: CI
22

33
on:
44
push:
@@ -13,16 +13,16 @@ permissions:
1313
contents: read
1414

1515
jobs:
16-
test:
17-
name: Run pytest
16+
ci:
17+
name: Test, compile, and Docker checks
1818
runs-on: ubuntu-latest
19-
timeout-minutes: 10
19+
timeout-minutes: 15
2020

2121
steps:
2222
- name: Check out repository
23-
uses: actions/checkout@v6
23+
uses: actions/checkout@v4
2424

25-
- name: Set up Python
25+
- name: Set up Python 3.12
2626
uses: actions/setup-python@v5
2727
with:
2828
python-version: "3.12"
@@ -34,7 +34,29 @@ jobs:
3434
python -m pip install --upgrade pip
3535
python -m pip install -r requirements.txt
3636
37-
- name: Run tests
37+
- name: Run deterministic test suite
3838
run: python -m pytest
3939

40-
40+
- name: Python compilation check
41+
run: python -m compileall src tests scripts -q
42+
43+
- name: Tracked-file hygiene check
44+
run: |
45+
bad=$(git ls-files | grep -E '(^|/)(\.(env|venv)|__pycache__|\.pytest_cache|\.DS_Store)($|/)' || true)
46+
if [ -n "$bad" ]; then
47+
echo "ERROR: tracked local artifacts found:"
48+
echo "$bad"
49+
exit 1
50+
fi
51+
echo "No tracked local artifacts found."
52+
53+
- name: Build Docker image
54+
run: docker build -t bug-triage-workflow .
55+
56+
- name: Docker CLI smoke test (--help, no API key)
57+
run: docker run --rm bug-triage-workflow --help
58+
59+
- name: Docker non-root check
60+
run: |
61+
docker run --rm --entrypoint id bug-triage-workflow | tee /tmp/container-id.txt
62+
! grep -q 'uid=0(root)' /tmp/container-id.txt

README.md

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -168,14 +168,15 @@ cat examples/security_bug.txt | python -m src.main
168168
|---|---|---|---|
169169
| Deterministic test suite | `python -m pytest` | Yes | 332 passed, 6 skipped |
170170
| Focused CLI/logging tests | `python -m pytest tests/test_main.py tests/test_logging_config.py -v` | No | 41 passed |
171-
| Python compilation | `python -m compileall src tests scripts -q` | Not yet | Passed locally |
172-
| Docker build | `docker build -t bug-triage-workflow .` | Not yet | Passed locally |
173-
| Docker CLI smoke test | `docker run --rm bug-triage-workflow --help` | Not yet | Passed locally |
174-
| Docker non-root check | `docker run --rm --entrypoint id bug-triage-workflow` | Not yet | uid=1000(appuser) |
171+
| Python compilation | `python -m compileall src tests scripts -q` | Yes | Passed locally |
172+
| Docker build | `docker build -t bug-triage-workflow .` | Yes | Passed locally |
173+
| Docker CLI smoke test | `docker run --rm bug-triage-workflow --help` | Yes | Passed locally |
174+
| Docker non-root check | `docker run --rm --entrypoint id bug-triage-workflow` | Yes | uid=1000(appuser) |
175+
| Tracked-file hygiene check | `git ls-files \| grep -E '…'` | Yes | No tracked artifacts |
175176
| Live adversarial evaluations | `python -m pytest tests/eval -m eval --run-evals -v` | No, opt-in | 6 passed |
176-
| Secret and tracked-file audit | Documented release-audit commands below | No | Passed locally; reverify before public release |
177+
| Full secret scan / public-release audit | Documented release-audit commands below | No | Passed locally; reverify before public release |
177178

178-
The GitHub Actions workflow (`.github/workflows/tests.yml`) installs dependencies on Python 3.12 and runs `python -m pytest` (deterministic suite only).
179+
The GitHub Actions workflow (`.github/workflows/tests.yml`) runs on Python 3.12 with pip caching and covers: dependency installation, deterministic test suite, Python compilation, tracked-file hygiene, Docker image build, Docker CLI smoke test, and Docker non-root check. No API key or secrets are required.
179180

180181
## Core Engineering Decisions
181182

@@ -556,7 +557,7 @@ Code quality:
556557

557558
CI/CD:
558559

559-
- Expand GitHub Actions to cover dependency installation, automated tests, linting, type checking, `compileall`, README link validation, and secret scanning.
560+
- Expand GitHub Actions to add linting, type checking, README link validation, and secret scanning.
560561
- Add branch protection and required status checks.
561562
- Use protected production environments for deployment workflows.
562563

0 commit comments

Comments
 (0)