Skip to content

Commit 8b0695a

Browse files
authored
Merge pull request #54 from jknoxdev:diagrams-update
Fix PlantUML render pipeline and redraw diagrams for presentation
2 parents 27b42cb + 0e74238 commit 8b0695a

20 files changed

Lines changed: 173 additions & 789 deletions

.github/workflows/render-diagrams.yml

Lines changed: 29 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -4,37 +4,55 @@ on:
44
push:
55
paths:
66
- '**.puml'
7+
- '.github/workflows/plantuml.yml'
78
workflow_dispatch:
89

10+
concurrency:
11+
group: ${{ github.workflow }}-${{ github.ref }}
12+
cancel-in-progress: true
13+
914
jobs:
1015
render:
1116
runs-on: ubuntu-latest
1217
permissions:
1318
contents: write
1419

20+
env:
21+
PLANTUML_VERSION: "1.2026.0"
22+
1523
steps:
1624
- name: Checkout repo
1725
uses: actions/checkout@v4
26+
27+
- name: Set up Java
28+
uses: actions/setup-java@v4
1829
with:
19-
fetch-depth: 0
30+
distribution: temurin
31+
java-version: '17'
32+
33+
- name: Install Graphviz
34+
run: sudo apt-get update -q && sudo apt-get install -y graphviz
35+
36+
- name: Fetch PlantUML jar
37+
run: |
38+
curl -fsSL -o plantuml.jar \
39+
"https://github.com/plantuml/plantuml/releases/download/v${PLANTUML_VERSION}/plantuml-${PLANTUML_VERSION}.jar"
40+
java -jar plantuml.jar -version
2041
21-
- name: Install PlantUML
42+
- name: Render svg
2243
run: |
23-
sudo apt-get update -q
24-
sudo apt-get install -y plantuml
44+
find . -name '*.puml' -not -path './.git/*' -print0 \
45+
| xargs -0 -r java -jar plantuml.jar -tsvg -nometadata -failfast2
2546
26-
- name: Render SVG and PNG
47+
- name: Render png
2748
run: |
28-
find . -name "*.puml" | while read f; do
29-
echo "Rendering $f"
30-
plantuml -tsvg "$f"
31-
plantuml -tpng "$f"
32-
done
49+
find . -name '*.puml' -not -path './.git/*' -print0 \
50+
| xargs -0 -r java -jar plantuml.jar -tpng -nometadata -failfast2
3351
3452
- name: Commit rendered diagrams
3553
uses: stefanzweifel/git-auto-commit-action@v5
3654
with:
37-
commit_message: "ci: auto-render PlantUML diagrams [skip ci]"
55+
commit_message: "ci: auto-render PlantUML diagrams"
3856
file_pattern: "**/*.svg **/*.png"
3957
commit_user_name: "github-actions[bot]"
4058
commit_user_email: "github-actions[bot]@users.noreply.github.com"

docs/architecture/component.png

-11.4 KB
Loading

docs/architecture/component.svg

Lines changed: 2 additions & 178 deletions
Loading

docs/architecture/context.png

1.62 KB
Loading

docs/architecture/context.svg

Lines changed: 2 additions & 92 deletions
Loading

docs/architecture/fsm-simple.png

22.3 KB
Loading

docs/architecture/fsm-simple.puml

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
@startuml fsm-simple
2+
!pragma layout smetana
3+
4+
skinparam {
5+
BackgroundColor #1a1a2e
6+
ArrowColor #7EC8E3
7+
ArrowFontColor #CCCCCC
8+
ArrowFontSize 13
9+
DefaultFontName Arial
10+
DefaultFontColor #E0E0E0
11+
DefaultFontSize 14
12+
StateBorderColor #4A90D9
13+
StateBorderThickness 2
14+
StateBackgroundColor #0f3460
15+
StateFontColor #FFFFFF
16+
StateFontSize 16
17+
NoteBackgroundColor #0D2818
18+
NoteBorderColor #27AE60
19+
NoteFontColor #27AE60
20+
NoteFontSize 13
21+
nodesep 36
22+
ranksep 38
23+
}
24+
25+
state "BOOT" as boot #1a3060
26+
state "CALIBRATING" as cal #2a1a0a
27+
state "ARMED" as armed #0D3320
28+
state "SLEEP" as sleep #0a1a3a
29+
state "EVENT\nDETECTED" as evt #2a1a4a
30+
state "SIGN" as sign #3a1a2a
31+
state "ENCRYPT" as enc #3a1a2a
32+
state "TX" as tx #0f3460
33+
34+
[*] -right-> boot
35+
boot -right-> cal : self-test\npass
36+
cal -right-> armed : baseline\nestablished
37+
armed -right-> sleep : idle
38+
sleep -right-> evt : sensor IRQ
39+
evt -right-> enc
40+
enc -right-> sign
41+
sign -left-> tx
42+
tx -up-> armed : re-arm
43+
44+
note bottom of cal
45+
Baseline is captured once.
46+
Drift after this point is signal.
47+
end note
48+
49+
@enduml

docs/architecture/fsm-simple.svg

Lines changed: 1 addition & 0 deletions
Loading

docs/architecture/node.png

14.4 KB
Loading

docs/architecture/node.puml

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
@startuml node
2+
3+
allowmixing
4+
5+
skinparam {
6+
BackgroundColor #1a1a2e
7+
ArrowColor #7EC8E3
8+
ArrowFontColor #CCCCCC
9+
ArrowFontSize 13
10+
DefaultFontName Arial
11+
DefaultFontColor #E0E0E0
12+
DefaultFontSize 14
13+
StateBorderColor #4A90D9
14+
StateBorderThickness 2
15+
StateBackgroundColor #0f3460
16+
StateFontColor #FFFFFF
17+
StateFontSize 16
18+
NoteBackgroundColor #0D2818
19+
NoteBorderColor #27AE60
20+
NoteFontColor #27AE60
21+
NoteFontSize 13
22+
PackageBorderColor #4A90D9
23+
PackageBackgroundColor #0f1a2e
24+
PackageFontColor #7EC8E3
25+
PackageFontSize 15
26+
nodesep 36
27+
ranksep 40
28+
}
29+
30+
package "LIMA Node"{
31+
32+
package "Sensors" {
33+
state "Motion" as motion #0D3320
34+
state "Barometric" as baro #2a1a0a
35+
state "Realtime\nClock" as rtc #2a1a4a
36+
}
37+
38+
package "MCU" {
39+
state "nRF52840" as mcu #1a3060
40+
}
41+
42+
}
43+
44+
state "nRF52840" as mcu #1a3060
45+
46+
motion -up-> mcu
47+
baro -up-> mcu
48+
rtc -up-> mcu
49+
50+
@enduml

0 commit comments

Comments
 (0)