CI graph builds
Goals in CI
- Track architectural drift between commits
- Publish graph JSON as a build artifact
- Fail builds when metrics exceed thresholds (custom scripts)
Minimal GitHub Actions job
jobs:
codegenome:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: '3.12'
- run: pip install codegenome
- run: codegenome analyze .
- run: codegenome export --format json --path .
- uses: actions/upload-artifact@v4
with:
name: codegenome-graph
path: .genome/exports/Legacy CLI in CI
python -m codegenome --workspace . --build --export json python -m codegenome --workspace . --print-metrics
Caching
Incremental builds use .genome/scan_cache.db. Cache that directory between runs to speed up PR builds:
- uses: actions/cache@v4
with:
path: .genome
key: codegenome-${{ runner.os }}-${{ hashFiles('**/*.py') }}Note
Do not commit .genome/ to git unless your team explicitly wants graph artifacts in version control. Add .genome/ to .gitignore for most projects.