Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 31 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,3 +35,34 @@ jobs:

- name: Test with pytest
run: pytest tests/ -v

- name: Build wheel and sdist
run: |
pip install build
python -m build

- name: Verify wheel contents
run: |
python - <<'PY'
import glob, zipfile
wheel = glob.glob("dist/*.whl")[0]
names = zipfile.ZipFile(wheel).namelist()
expected = ["hotspot_merge", "ownership_diff", "parse_semgrep", "parse_trivy", "risk_update", "scan_drift"]
missing = [m for m in expected if f"{m}.py" not in names]
assert not missing, f"wheel missing modules: {missing}; contents: {names}"
PY

- name: Smoke test built wheel in clean environment
run: |
python -m venv "$RUNNER_TEMP/smoke"
"$RUNNER_TEMP/smoke/bin/pip" install dist/*.whl
cd "$RUNNER_TEMP"
"$RUNNER_TEMP/smoke/bin/python" -c "import hotspot_merge, ownership_diff, parse_semgrep, parse_trivy, risk_update, scan_drift"
"$RUNNER_TEMP/smoke/bin/python" -m hotspot_merge --help

- name: Upload dist artifacts
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
with:
name: dist
path: dist/
if-no-files-found: error
6 changes: 5 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
@@ -1,20 +1,24 @@
# Makefile for Architecture Governance Toolkit

.PHONY: help build-analysis-image run-analysis adr-new artifacts-dir
.PHONY: help build build-analysis-image run-analysis adr-new artifacts-dir sbom hotspots ownership drift risk full-analysis clean

ANALYSIS_IMAGE=analysis:local
ARTIFACTS_DIR=artifacts

help:
@echo "Architecture Governance Toolkit - Available Commands:"
@echo ""
@echo " make build - Build Python wheel and sdist package artifacts"
@echo " make artifacts-dir - Create artifacts directory"
@echo " make build-analysis-image - Build Docker analysis image"
@echo " make run-analysis - Run analysis in Docker"
@echo " make adr-new TITLE='...' - Create new ADR"
@echo " make clean - Remove artifacts directory"
@echo ""

build:
python3 -m build

artifacts-dir:
mkdir -p $(ARTIFACTS_DIR)/sbom $(ARTIFACTS_DIR)/timeseries

Expand Down
16 changes: 16 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -356,6 +356,22 @@ Optional for extended features:
- Trivy and/or Semgrep for security scanning
- Syft for SBOM generation

### Local Build and Validation

Run the unit tests and the full governance analysis pipeline:

```bash
python3 -m pytest && make full-analysis
```

Build the wheel and sdist locally (written to `dist/`; requires `pip install build`):

```bash
make build
```

CI builds these artifacts, inspects the wheel contents, smoke-tests it in a clean environment and uploads `dist/` as a CI artifact only. No release or publication has occurred.

### Option 1: Run Directly

```bash
Expand Down
13 changes: 10 additions & 3 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,16 @@ dev = [
"ruff>=0.4.0",
]

[tool.setuptools.packages.find]
where = ["scripts"]
include = []
[tool.setuptools]
package-dir = {"" = "scripts"}
py-modules = [
"hotspot_merge",
"ownership_diff",
"parse_semgrep",
"parse_trivy",
"risk_update",
"scan_drift",
]

[tool.pytest.ini_options]
testpaths = ["tests"]
Expand Down
Loading