-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
9a76fdf
commit 6e1d000
Showing
2 changed files
with
112 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,102 @@ | ||
name: Render All Diagrams | ||
|
||
on: | ||
push: | ||
paths: | ||
- '**/Material/images/src/**/*.puml' | ||
- '**/Material/images/src/**/*.drawio' | ||
branches-ignore: | ||
- 'main**' | ||
|
||
# Allows you to run this workflow manually from the Actions tab | ||
workflow_dispatch: | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
|
||
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it | ||
- name: Checkout repository | ||
uses: actions/checkout@v4 | ||
|
||
# Installs Java distribution for running the plantUML jar | ||
- name: Install Java | ||
uses: actions/setup-java@v3 | ||
with: | ||
distribution: 'temurin' | ||
java-version: '17' | ||
check-latest: true | ||
|
||
# Install graphviz for plantuml | ||
- name: Setup Graphviz | ||
uses: ts-graphviz/setup-graphviz@v1 | ||
|
||
# Download plantUML jar | ||
- name: Download plantuml file | ||
run: | | ||
wget -O plantuml.jar "https://github.com/plantuml/plantuml/releases/latest/download/plantuml.jar" | ||
# Clean Folder | ||
- name: Ensure and clean folder | ||
run: | | ||
img_dir=Material/images/diagrams | ||
mkdir -p $img_dir | ||
rm -rf Material/images/diagrams/*.svg | ||
# Generate the SVGs from PUML | ||
- name: Render PUML to SVG and Move files | ||
run: | | ||
FileNamePaths=$(find . -path "*/images/src/*/*.puml" -exec dirname {} \; | sort -u) | ||
for dir in $FileNamePaths | ||
do | ||
# Render SVGs from PUMLs | ||
find $dir -name "*.puml" -exec java -jar plantuml.jar -tsvg {} \; | ||
done | ||
# Remove plantUML jar | ||
- name: remove plantuml file | ||
run: | | ||
rm -f plantuml.jar | ||
# Generate the SVGs from DrawIO | ||
- name: Render DrawIO to SVG with predefined action | ||
uses: rlespinasse/drawio-export-action@v2 | ||
with: | ||
path: ./Material/images/src/drawio/ | ||
remove-page-suffix: true | ||
output: . | ||
format: svg | ||
action-mode: all | ||
|
||
# copies the created SVG files to the images/diagrams folder and deletes the drawio files | ||
- name: Move SVGs to target image folder | ||
run: | | ||
img_dir=Material/images/diagrams | ||
# Find all unique directories containing *.SVGs files under any /imgsrc/ folder | ||
FileNamePaths=$(find . -path "*/images/src/*/*.svg" -exec dirname {} \; | sort -u) | ||
for dir in $FileNamePaths | ||
do | ||
# Move SVGs to out directory | ||
find $dir -name "*.svg" -exec mv {} $img_dir \; | ||
done | ||
## add and commit the new generated files | ||
#- name: Create Pull Request | ||
# uses: peter-evans/create-pull-request@v5 | ||
# with: | ||
# branch: auto/images-generation | ||
# commit-message: Generated Images from source Code by GitHub Action | ||
# title: Generated Images from GitHub Action | ||
# assignees: ${{ github.actor }} | ||
# reviewers: ${{ github.actor }} | ||
# delete-branch: true | ||
# labels: automated pr | ||
|
||
- name: Commit rendered files | ||
uses: stefanzweifel/git-auto-commit-action@v5 | ||
with: | ||
commit_user_name: GitHub Actions Bot | ||
commit_user_email: [email protected] | ||
commit_message: auto-generated diagrams by GitHub Action after source code change |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,12 +4,15 @@ name: CI (FHIR Validation) | |
|
||
# Controls when the action will run. | ||
on: | ||
# Triggers the workflow on push or pull request events | ||
# Triggers the workflow on push or pull request events but only for the master branch | ||
push: | ||
paths: | ||
- 'Resources/**' | ||
branches-ignore: | ||
- 'main**' | ||
pull_request: | ||
|
||
# Allows you to run this workflow manually from the Actions tab | ||
workflow_dispatch: | ||
branches: | ||
- 'main**' | ||
|
||
# A workflow run is made up of one or more jobs that can run sequentially or in parallel | ||
jobs: | ||
|
@@ -46,4 +49,7 @@ jobs: | |
- name: Add & Commit | ||
uses: EndBug/add-and-commit@v7 | ||
with: | ||
committer_name: GitHub Actions Bot | ||
committer_email: [email protected] | ||
add: 'Resources/fsh-generated/resources/' | ||
message: auto-generated FHIR files by GitHub Actions (CI FSH to FHIR Validation) |