Basic CI/CD Pipeline
Build → test → deploy pipeline for a small severity-classification library—real unit tests, containerized build/test, and deploy that only runs after green tests (image tar + manifest).
StackPython 3 · unittest · Docker · GitHub Actions
Signalsunittest · containerized CI · needs-gated deploy · docker save
Requirements outline
Scope this page covers. Each row is an acceptance item the automation targets; delivery is what ships in this revision.
| ID | Requirement | Delivery |
|---|---|---|
| FR1 | Real application logic | pipeline_app severity classifiers + build_summary with branching logic |
| FR2 | Real automated tests | tests/test_severity.py — boundaries, ValueError cases, integration summary |
| FR3 | GHA Build → Test → Deploy | .github/workflows/ci.yml with three jobs and real deploy artifacts |
| FR4 | Containerized build/test | jobs use container: python:3.12-slim-bookworm; project Dockerfile for the app image |
| FR5 | Failing tests block deploy | deploy.needs: [test] + if: success(); prove script evidence under evidence/ |
Evidence




Terminal captures from the lab host. Click an image to expand fullscreen.
Problem
I wanted an end-to-end CI path that is not a toy: compile/prepare in a container, run tests with real assertions, and produce a deploy artifact only when tests pass—with evidence that a failing test skips deploy.
Approach
Standalone pipeline_app library (usage/load severity, worst-of, exit codes) with unittest suite. GitHub Actions workflow: build and test jobs use python:3.12-slim; deploy needs test and if success(), then docker build + docker save + JSON manifest. Local make prove records a deliberate failure path and a green deploy. Deploy is never echo-only.
Outcomes
- 13 unittest cases green on clean tree
- Deliberate failing assertion exits non-zero; deploy skipped (evidence logs)
- Green path produces pipeline-app image tar + deploy-manifest JSON under artifacts/
- Workflow YAML commits needs: [test] and if: success() on deploy
- Containerized build/test via python:3.12-slim-bookworm