Skip to content

Commit

Permalink
upgrade ci integration
Browse files Browse the repository at this point in the history
  • Loading branch information
MaxMTheilig committed Mar 15, 2024
1 parent fa8d385 commit 6551c70
Show file tree
Hide file tree
Showing 2 changed files with 41 additions and 7 deletions.
44 changes: 39 additions & 5 deletions .github/workflows/RenderAllDiagrams.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ on:
paths:
- '**/Material/images/src/**/*.puml'
- '**/Material/images/src/**/*.drawio'
- '**/Material/images/src/**/*.bpmn'
branches-ignore:
- 'main**'

Expand Down Expand Up @@ -38,15 +39,16 @@ jobs:
run: |
wget -O plantuml.jar "https://github.com/plantuml/plantuml/releases/latest/download/plantuml.jar"
# Clean Folder
# Ensure Folder exsists, otherwise, create it
- name: Ensure and clean folder
run: |
img_dir=Material/images/diagrams
mkdir -p $img_dir
rm -rf Material/images/diagrams/*.svg
# do not clean
# rm -rf Material/images/diagrams/*.svg

# Generate the SVGs from PUML
- name: Render PUML to SVG and Move files
- name: Render PUML to SVG files
run: |
FileNamePaths=$(find . -path "*/images/src/*/*.puml" -exec dirname {} \; | sort -u)
for dir in $FileNamePaths
Expand All @@ -70,7 +72,34 @@ jobs:
format: svg
action-mode: all

# Install note.js and bpmn-to-image
- name: Install Notejs and pbmn-to-image
uses: actions/setup-node@v4
with:
node-version: 18
- run: npm install -g bpmn-to-image

# Generate the SVGs from BPMN
- name: Render BPMN to SVG files
run: |
FileNamePaths=$(find . -path "*/images/src/*/*.bpmn" -exec dirname {} \; | sort -u)
for dir in $FileNamePaths
do
# Render SVGs from BPMN
echo $dir
FileBaseNames=$(find $dir -name "*.bpmn" -exec basename "{}" ".bpmn" \; | sort -u)
#FileBaseNames=$(find $dir -name "*.bpmn" | xargs -L1 -I{} basename "{}")
for base in $FileBaseNames
do
echo $base
bpmn-to-image "$dir/$base.bpmn":"$dir/$base.svg";
done
done
# copies the created SVG files to the images/diagrams folder and deletes the drawio files
# mv for copy and delete, here
- name: Move SVGs to target image folder
run: |
img_dir=Material/images/diagrams
Expand All @@ -79,7 +108,8 @@ jobs:
for dir in $FileNamePaths
do
# Move SVGs to out directory
find $dir -name "*.svg" -exec mv {} $img_dir \;
# find $dir -name "*.svg" -exec rm -rf {} $img_dir \;
find $dir -name "*.svg" -exec mv -f {} $img_dir \;
done
## add and commit the new generated files
Expand All @@ -99,4 +129,8 @@ jobs:
with:
commit_user_name: GitHub Actions Bot
commit_user_email: [email protected]
commit_message: auto-generated diagrams by GitHub Action after source code change
commit_message: auto-generated diagrams by GitHub Action after source code change

- name: "Run if no changes have been detected"
if: steps.auto-commit-action.outputs.changes_detected == 'false'
run: echo "No Changes!"
4 changes: 2 additions & 2 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ jobs:
# Steps represent a sequence of tasks that will be executed as part of the job
steps:
- name: Checkout code
uses: actions/checkout@v2
uses: actions/checkout@v4

# Java and .NET are already installed on ubuntu-latest

Expand All @@ -50,7 +50,7 @@ jobs:
EXPECTED_FAILS: VALIDATION_CONFORMANCE_DOTNET VALIDATION_CONFORMANCE_JAVA VALIDATION_EXAMPLES_JAVA

- name: Add & Commit
uses: EndBug/add-and-commit@v7
uses: EndBug/add-and-commit@v9
with:
committer_name: GitHub Actions Bot
committer_email: [email protected]
Expand Down

0 comments on commit 6551c70

Please sign in to comment.