Skip to content

Commit

Permalink
try
Browse files Browse the repository at this point in the history
  • Loading branch information
stiebels committed Jul 26, 2023
1 parent 799a02c commit 57fadc5
Show file tree
Hide file tree
Showing 2 changed files with 46 additions and 1 deletion.
32 changes: 31 additions & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,39 @@ jobs:
steps:
- name: Check out repository
uses: actions/checkout@v3
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: "3.10"
- name: Update Pip
run: pip install -U pip
- name: Install required dependencies
run: pip install py2puml
- name: Build Class Diagram
id: build_class_diagram
run: |
if test -f ${INPUT_PUML_OUTPUT_PATH}; then
py2puml ${INPUT_PATH} ${INPUT_MODULE} > ${INPUT_PUML_OUTPUT_PATH}_staging
update_class_diagram=$(
if [[ $(diff ${INPUT_PUML_OUTPUT_PATH}_staging ${INPUT_PUML_OUTPUT_PATH}) ]]; then
echo "true"
else
echo "false"
fi
)
if [ $update_class_diagram = "true" ]; then
mv ${INPUT_PUML_OUTPUT_PATH}_staging ${INPUT_PUML_OUTPUT_PATH}
else
rm ${INPUT_PUML_OUTPUT_PATH}_staging
fi
else
py2puml ${INPUT_PATH} ${INPUT_MODULE} > ${INPUT_PUML_OUTPUT_PATH}
update_class_diagram="true"
fi
echo "update_class_diagram=${update_class_diagram}" >> "$GITHUB_OUTPUT"
- name: Render diagram
uses: ./
with:
args: "-tpng test_diagram.puml"
args: "-tpng "${INPUT_PNG_OUTPUT_PATH}
- name: Display diagram
run: cat test_diagram.png
15 changes: 15 additions & 0 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,21 @@ description: GitHub Action for drawing UML diagrams with PlantUML
inputs:
version:
description: PlantUML software version
required: false
path:
description: the filepath to the domain following the py2puml definition
required: true
module:
description: the module name of the domain following the py2puml definition
required: true
png_output_path:
description: the filepath to the output PNG
default: class_diagram.png
required: false
puml_output_path:
description: the filepath to the output PUML
default: class_diagram.puml
required: false
runs:
using: docker
image: Dockerfile
Expand Down

0 comments on commit 57fadc5

Please sign in to comment.