CI/CD Integration#
GitHub Actions Workflow#
Create .github/workflows/traceability.yml:
name: Requirements Traceability
on: [push, pull_request]
jobs:
traceability:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: '3.10'
- name: Install dependencies
run: pip install jamb pytest
- name: Validate requirements
run: jamb validate
- name: Check requirement coverage
run: jamb check
- name: Run tests with traceability
run: pytest --jamb --jamb-fail-uncovered --jamb-trace-matrix matrix.html
- name: Upload traceability matrix
uses: actions/upload-artifact@v4
if: always()
with:
name: traceability-matrix
path: matrix.html
Key CI Commands#
Command |
Purpose |
Fails On |
|---|---|---|
|
Check requirements tree integrity |
Broken links, cycles, conformance violations (suspect links are warnings; use |
|
Static test coverage scan |
Uncovered requirements in test documents |
|
Run tests with coverage enforcement |
Uncovered requirements or test failures |
Note:
jamb validateexits with a non-zero status only when errors are found. Suspect links and conformance issues are reported as warnings by default and do not cause a non-zero exit. To treat warnings as errors, usejamb validate --error-all.
Pre-commit Hook#
Add to .pre-commit-config.yaml:
repos:
- repo: local
hooks:
- id: jamb-validate
name: Validate requirements
entry: jamb validate
language: system
pass_filenames: false
This runs jamb validate on every commit to catch broken links and suspect items early.
Recommended Pipeline#
A typical CI pipeline for a regulated project:
Validate –
jamb validateensures the requirements tree is structurally soundTest –
pytest --jamb --jamb-fail-uncoveredruns tests and checks coverageMatrix –
--jamb-trace-matrix matrix.htmlgenerates the traceability matrix artifactPublish – (optional)
jamb publish all ./docs --htmlgenerates requirement documents
Strict Mode#
For maximum enforcement, use jamb validate --error-all to treat all warnings (including suspect links) as errors:
- name: Strict validation
run: jamb validate --error-all
Skipping Documents#
If certain documents are not yet ready for CI enforcement:
- name: Validate (skip UT)
run: jamb validate --skip UT