Skip to content

Commit fea9b63

Browse files
committed
automate UML diagrams
1 parent 77058ee commit fea9b63

File tree

1 file changed

+45
-0
lines changed

1 file changed

+45
-0
lines changed

.github/workflows/uml.yml

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
name: Update the UML Diagrams
2+
3+
on:
4+
pull_request:
5+
branches: [main]
6+
paths:
7+
- "causalpy/**"
8+
push:
9+
branches: [main]
10+
paths:
11+
- "causalpy/**"
12+
13+
jobs:
14+
build:
15+
runs-on: ubuntu-latest
16+
17+
steps:
18+
- name: Checkout repository
19+
uses: actions/checkout@v2
20+
21+
- name: Set up Python
22+
uses: actions/setup-python@v2
23+
with:
24+
python-version: "3.10"
25+
26+
- name: Configure Git Identity
27+
run: |
28+
git config user.name "$(git log -n 1 --pretty=format:%an)"
29+
git config user.email "$(git log -n 1 --pretty=format:%ae)"
30+
31+
- name: Update the UML Diagrams
32+
run: |
33+
sudo apt-get update && sudo apt-get install -y graphviz
34+
pip install --upgrade pip && pip install ".[docs]"
35+
make uml
36+
37+
- name: Push up the changes
38+
run: |
39+
git add docs/source/_static/*.png
40+
if git diff --staged --exit-code; then
41+
echo "No changes to commit"
42+
else
43+
git commit -m "Update UML Diagrams"
44+
git push
45+
fi

0 commit comments

Comments
 (0)