Skip to content

Commit

Permalink
[lab][1][doc] edited object model, added github action to generate pu…
Browse files Browse the repository at this point in the history
…ml images
  • Loading branch information
vityaman committed Sep 7, 2023
1 parent fe9c2ae commit 96c0c01
Show file tree
Hide file tree
Showing 2 changed files with 67 additions and 12 deletions.
46 changes: 46 additions & 0 deletions .github/workflows/puml.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
name: Generate PlantUML Diagrams
on:
push:
paths:
- '**.puml'
jobs:
ci:
runs-on: ubuntu-latest
env:
UML_FILES: ".puml"
steps:
- name: Checkout Source
uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Get changed UML files
id: getfile
run: |
git diff-tree -r --no-commit-id --summary ${{ github.sha }} \
| awk -F' ' '{
# ensure we are not trying to process deleted files
# only process puml files
# do not try to process our theme or custom config
if ( $1 !~ /^delete$/ && $4 ~ /\.puml$/ && $4 !~ /(theme|config)\.puml$/ )
{
# only print the file name and strip newlines for spaces
printf "::set-output name=files::" "%s ", $4
}
}
END { print "" } # ensure we do print a newline at the end
'
- name: UML files considered echo output
run: |
echo ${{ steps.getfile.outputs.files }}
- name: Generate SVG Diagrams
uses: cloudbees/plantuml-github-action@master
with:
args: -v -tsvg ${{ steps.getfile.outputs.files }}
- name: Push Local Changes
uses: stefanzweifel/git-auto-commit-action@v4.1.2
with:
commit_user_name: "vityaman"
commit_user_email: "vityaman.dev@yandex.com"
commit_author: "vityaman <vityaman.dev@yandex.com>"
commit_message: "[doc] Generate SVG images for PlantUML diagrams"
branch: ${{ github.head_ref }}
33 changes: 21 additions & 12 deletions doc/lab-1/object.puml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,10 @@
interface Object

Creature --> Object
interface Creature
Creature --* Action
interface Creature {
action: Action
}

MysteriousCreature --> Creature
class MysteriousCreature
Expand All @@ -12,7 +15,23 @@ Plant --> Object
interface Plant

Animal --> Creature
interface Animal
Animal --* Gender
Animal --* Emotion
interface Animal {
name: String
gender: GenderEmotion
emotions: Collection[Emotion]
}

enum Gender {
MALE
FEMALE
}

enum Emotion {
IMPRESSION
PAIN
}

Tree --> Plant
class Tree
Expand Down Expand Up @@ -53,14 +72,4 @@ class Down
Away --> Target
class Away

interface Emotion

Impression --> Emotion
class Impression

Pain --> Emotion
class Pain



@enduml

0 comments on commit 96c0c01

Please sign in to comment.