-
Notifications
You must be signed in to change notification settings - Fork 66
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
automate UML diagrams #395
base: main
Are you sure you want to change the base?
Changes from 11 commits
fea9b63
1f24d79
acdc701
59cb1d3
b45b80e
d3eba52
9ba3e8a
bc7a35f
9584b76
bc2b31e
7c0913b
1a4cfb9
5395342
acd4544
3fa282e
06c9779
59a4624
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
name: Update the UML Diagrams | ||
|
||
permissions: write-all | ||
|
||
on: | ||
pull_request: | ||
branches: [main] | ||
# paths: | ||
# - "causalpy/**" | ||
push: | ||
branches: [main] | ||
# paths: | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Remove commented out code? |
||
# - "causalpy/**" | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
|
||
wd60622 marked this conversation as resolved.
Show resolved
Hide resolved
|
||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v2 | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Think this needs to be v4 |
||
with: | ||
ref: ${{ github.head_ref || 'main' }} | ||
|
||
- name: Set up Python | ||
uses: actions/setup-python@v2 | ||
with: | ||
python-version: "3.10" | ||
|
||
- name: Configure Git Identity | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I am very much a beginner when it comes to GitHub actions, but I've not seen anything about coffin of git identity in the other workflows. Could this be related to the permissions issue? Or is it required for the later pushed changes? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Required for pushing later. Could be cause of permission. Not sure at the moment There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Think it might be if repo doesn't allow for bots to push code. I am seeing that the pre-commit bot didn't push either though the command was recognized |
||
run: | | ||
git config user.name "$(git log -n 1 --pretty=format:%an)" | ||
git config user.email "$(git log -n 1 --pretty=format:%ae)" | ||
|
||
- name: Update the UML Diagrams | ||
run: | | ||
sudo apt-get update && sudo apt-get install -y graphviz | ||
pip install --upgrade pip && pip install ".[docs]" | ||
make uml | ||
|
||
- name: Push up the changes | ||
run: | | ||
git add docs/source/_static/*.png | ||
if git diff --staged --exit-code; then | ||
echo "No changes to commit" | ||
else | ||
echo "Committing the changes" | ||
echo ${GITHUB_HEAD_REF} | ||
git commit -m "Update UML Diagrams" | ||
git push origin HEAD:${GITHUB_HEAD_REF} | ||
fi | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remove commented out code?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, at end since the files that changed wouldn't trigger this action