47 lines
1.5 KiB
YAML
47 lines
1.5 KiB
YAML
name: Knowledge Graph (Template)
|
|
|
|
on:
|
|
workflow_call:
|
|
|
|
jobs:
|
|
update-graph:
|
|
runs-on: ive
|
|
timeout-minutes: 30
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
|
|
- name: Install graphify
|
|
run: pip install --quiet --user --break-system-packages 'graphifyy[openai]'
|
|
|
|
- name: Link graphify-out under .gitea/
|
|
run: |
|
|
mkdir -p .gitea/graphify-out
|
|
ln -sfn .gitea/graphify-out graphify-out
|
|
|
|
- name: Update knowledge graph (incremental, AST-only, no LLM)
|
|
run: |
|
|
export PATH="$HOME/.local/bin:$PATH"
|
|
graphify update .
|
|
|
|
- name: Name communities via local LLM (incremental, missing labels only)
|
|
run: |
|
|
export PATH="$HOME/.local/bin:$PATH"
|
|
export OPENAI_BASE_URL="http://10.2.2.54:5625/v1"
|
|
export OPENAI_MODEL="ive-brain"
|
|
export OPENAI_API_KEY=${{ secrets.LLM_API_KEY }}
|
|
graphify label . --missing-only --backend openai --model ive-brain --max-concurrency 1
|
|
|
|
- name: Drop graphify's dated backup snapshot
|
|
run: rm -rf .gitea/graphify-out/[0-9][0-9][0-9][0-9]-[0-9][0-9]-[0-9][0-9]
|
|
|
|
- name: Commit graph if it changed
|
|
run: |
|
|
git config user.name "ive"
|
|
git config user.email "system-ive-code-review@technarts.com"
|
|
git add .gitea/graphify-out/
|
|
if git diff --cached --quiet; then
|
|
exit 0
|
|
fi
|
|
git commit -m "chore: update graphify knowledge graph [skip-graphify]"
|
|
git push origin HEAD:main
|