remove gh action
This commit is contained in:
@@ -1,70 +0,0 @@
|
|||||||
name: Generate UML
|
|
||||||
|
|
||||||
# Trigger whenever the domain model or the generator script itself changes.
|
|
||||||
# "workflow_dispatch" lets you re-run it manually from the GitHub UI.
|
|
||||||
on:
|
|
||||||
push:
|
|
||||||
paths:
|
|
||||||
- "src/netdiag/domain/models.py"
|
|
||||||
- "scripts/generate_uml.py"
|
|
||||||
workflow_dispatch:
|
|
||||||
|
|
||||||
# The job needs write access so it can push the generated files back.
|
|
||||||
permissions:
|
|
||||||
contents: write
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
generate-uml:
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
|
|
||||||
steps:
|
|
||||||
# ── 1. check out the repository ────────────────────────────────────────
|
|
||||||
- uses: actions/checkout@v4
|
|
||||||
|
|
||||||
# ── 2. set up Python (stdlib only – no pip packages needed) ────────────
|
|
||||||
- uses: actions/setup-python@v5
|
|
||||||
with:
|
|
||||||
python-version: "3.11"
|
|
||||||
|
|
||||||
# ── 3. generate UML/UML.d2 from models.py ──────────────────────────────
|
|
||||||
- name: Generate D2 source
|
|
||||||
run: python scripts/generate_uml.py src/netdiag/domain/models.py UML/UML.d2
|
|
||||||
|
|
||||||
# ── 4. install the D2 CLI ───────────────────────────────────────────────
|
|
||||||
#
|
|
||||||
# The official install script detects the platform and drops the binary
|
|
||||||
# into one of several locations depending on how the shell is invoked.
|
|
||||||
# We add all common candidates to GITHUB_PATH so the next step finds it
|
|
||||||
# regardless of where the script chose to install.
|
|
||||||
#
|
|
||||||
# Pin a specific version to keep renders reproducible.
|
|
||||||
# Bump this when you want to adopt a newer D2 release.
|
|
||||||
- name: Install D2
|
|
||||||
env:
|
|
||||||
D2_VERSION: "0.7.1"
|
|
||||||
run: |
|
|
||||||
curl -fsSL \
|
|
||||||
"https://github.com/terrastruct/d2/releases/download/v${D2_VERSION}/d2-v${D2_VERSION}-linux-amd64.tar.gz" \
|
|
||||||
| tar -xz -C /tmp
|
|
||||||
sudo install -m 0755 \
|
|
||||||
"/tmp/d2-v${D2_VERSION}-linux-amd64/bin/d2" \
|
|
||||||
/usr/local/bin/d2
|
|
||||||
d2 --version
|
|
||||||
|
|
||||||
# ── 5. render SVG ───────────────────────────────────────────────────────
|
|
||||||
- name: Render UML/UML.svg
|
|
||||||
run: d2 UML/UML.d2 UML/UML.svg
|
|
||||||
|
|
||||||
# ── 6. commit generated files back to the repo ─────────────────────────
|
|
||||||
#
|
|
||||||
# stefanzweifel/git-auto-commit-action is a thin wrapper around
|
|
||||||
# "git add / git commit / git push". It silently skips the commit when
|
|
||||||
# nothing has changed, so re-running the workflow is always safe.
|
|
||||||
#
|
|
||||||
# The "[skip ci]" suffix prevents this commit from re-triggering CI
|
|
||||||
# (GitHub Actions honors this convention natively).
|
|
||||||
- name: Commit generated UML files
|
|
||||||
uses: stefanzweifel/git-auto-commit-action@v5
|
|
||||||
with:
|
|
||||||
commit_message: "chore: auto-generate UML diagrams [skip ci]"
|
|
||||||
file_pattern: "UML/UML.d2 UML/UML.svg"
|
|
||||||
-113
@@ -1,113 +0,0 @@
|
|||||||
direction: down
|
|
||||||
|
|
||||||
Interface: {
|
|
||||||
shape: class
|
|
||||||
|
|
||||||
name: str
|
|
||||||
itype: "[str]"
|
|
||||||
adapter: "[str]"
|
|
||||||
slave_interfaces: "[List[str]]"
|
|
||||||
parent_interface: "[str]"
|
|
||||||
ip_address: "[str]"
|
|
||||||
network: "[str]"
|
|
||||||
subnet_mask: "[str]"
|
|
||||||
default_gateway: "[str]"
|
|
||||||
vlan: "[str]"
|
|
||||||
device: Device
|
|
||||||
|
|
||||||
"__init__(name, ...)"
|
|
||||||
"__repr__(): str"
|
|
||||||
}
|
|
||||||
|
|
||||||
Device: {
|
|
||||||
shape: class
|
|
||||||
|
|
||||||
name: str
|
|
||||||
role: str
|
|
||||||
interfaces: "Dict[str, Interface]"
|
|
||||||
|
|
||||||
"__init__(name: str)"
|
|
||||||
"add_interface(interface: Interface)"
|
|
||||||
"rm_interface(interface: Interface)"
|
|
||||||
"__repr__(): str"
|
|
||||||
}
|
|
||||||
|
|
||||||
Host: {
|
|
||||||
shape: class
|
|
||||||
|
|
||||||
role: str
|
|
||||||
}
|
|
||||||
|
|
||||||
Router: {
|
|
||||||
shape: class
|
|
||||||
|
|
||||||
role: str
|
|
||||||
}
|
|
||||||
|
|
||||||
Switch: {
|
|
||||||
shape: class
|
|
||||||
|
|
||||||
role: str
|
|
||||||
}
|
|
||||||
|
|
||||||
Network: {
|
|
||||||
shape: class
|
|
||||||
|
|
||||||
name: str
|
|
||||||
interfaces: "List[Interface]"
|
|
||||||
network_ip: "[str]"
|
|
||||||
|
|
||||||
"__init__(name: str, [vlan: [str]], [network_ip: [str]])"
|
|
||||||
"add_interface(interface: Interface)"
|
|
||||||
"rm_interface(interface: Interface)"
|
|
||||||
"__repr__(): str"
|
|
||||||
}
|
|
||||||
|
|
||||||
Topology: {
|
|
||||||
shape: class
|
|
||||||
|
|
||||||
devices: "Dict[str, Device]"
|
|
||||||
networks: "Dict[str, Network]"
|
|
||||||
|
|
||||||
"__init__()"
|
|
||||||
"add_device(device: Device)"
|
|
||||||
"rm_device(device: Device)"
|
|
||||||
"add_network(network: Network)"
|
|
||||||
"rm_network(network: Network)"
|
|
||||||
"__repr__(): str"
|
|
||||||
}
|
|
||||||
|
|
||||||
Host -> Device: {
|
|
||||||
target-arrowhead.shape: triangle
|
|
||||||
target-arrowhead.style.filled: false
|
|
||||||
}
|
|
||||||
|
|
||||||
Router -> Device: {
|
|
||||||
target-arrowhead.shape: triangle
|
|
||||||
target-arrowhead.style.filled: false
|
|
||||||
}
|
|
||||||
|
|
||||||
Switch -> Device: {
|
|
||||||
target-arrowhead.shape: triangle
|
|
||||||
target-arrowhead.style.filled: false
|
|
||||||
}
|
|
||||||
|
|
||||||
Device -- Interface: interfaces {
|
|
||||||
source-arrowhead: 1..*
|
|
||||||
target-arrowhead: 1
|
|
||||||
}
|
|
||||||
|
|
||||||
Network -- Interface: interfaces {
|
|
||||||
source-arrowhead: 1..*
|
|
||||||
target-arrowhead: 1
|
|
||||||
}
|
|
||||||
|
|
||||||
Topology -- Device: devices {
|
|
||||||
source-arrowhead: 1..*
|
|
||||||
target-arrowhead: 1
|
|
||||||
}
|
|
||||||
|
|
||||||
Topology -- Network: networks {
|
|
||||||
source-arrowhead: 1..*
|
|
||||||
target-arrowhead: 1
|
|
||||||
}
|
|
||||||
-105
File diff suppressed because one or more lines are too long
|
Before Width: | Height: | Size: 41 KiB |
Reference in New Issue
Block a user