CI graph builds

Goals in CI

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.