Skip to content

Commit 5f7b945

Browse files
committed
Generate diagram workflow
1 parent 5553970 commit 5f7b945

File tree

2 files changed

+45
-0
lines changed

2 files changed

+45
-0
lines changed

.github/workflows/diagram.yml

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
name: Render Mermaid Diagrams
2+
on:
3+
push:
4+
paths:
5+
- 'docs/*.mmd' # Trigger only when mermaid files change
6+
7+
jobs:
8+
render:
9+
runs-on: ubuntu-latest
10+
steps:
11+
- name: Checkout code
12+
uses: actions/checkout@v4
13+
14+
- name: Install Mermaid CLI
15+
run: npm install -g @mermaid-js/mermaid-cli
16+
17+
- name: Render Diagram
18+
run: mmdc -i docs/architecture.mmd -o docs/images/architecture.svg -t neutral
19+
20+
- name: Commit and Push
21+
run: |
22+
git config --local user.email "action@github.com"
23+
git config --local user.name "GitHub Action"
24+
git add docs/images/architecture.svg
25+
git commit -m "docs: update rendered mermaid diagram" || exit 0
26+
git push

docs/architecture.mmd

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
sequenceDiagram
2+
autonumber
3+
participant Pytest as Pytest runner
4+
participant ProcFactory as postgresql_proc_factory
5+
participant PgServer as PostgreSQL process
6+
participant TemplateDB as Template DB (seeded)
7+
participant TestDB as Per-test DB (clone)
8+
9+
Pytest->>ProcFactory: request postgresql_proc with load=[load_database]
10+
ProcFactory->>PgServer: start server
11+
ProcFactory->>TemplateDB: invoke load_database (create metadata, seed data)
12+
Note right of TemplateDB: Template is created and seeded once per full run
13+
loop per test
14+
Pytest->>PgServer: request clone of TemplateDB
15+
PgServer->>TestDB: create cloned database for test
16+
Pytest->>TestDB: run test using cloned DB
17+
Pytest->>TestDB: teardown: commit transaction
18+
Pytest->>TestDB: teardown: drop_all metadata (cleanup)
19+
end

0 commit comments

Comments
 (0)