Skip to content

Commit

Permalink
Add plots to step summary
Browse files Browse the repository at this point in the history
  • Loading branch information
michaelmior committed Aug 28, 2024
1 parent f64d41b commit 26755c3
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 0 deletions.
12 changes: 12 additions & 0 deletions .github/plot_markdown.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
import glob
import json
import os


if __name__ == '__main__':
img_urls = json.loads(os.environ['IMG_URLS'])
img_files = glob.glob('dist/results/plots/*.png')
for (url, file) in zip(img_urls, img_files):
name = file.split('/')[-1].split('.')[0]
print(f"## {name}")
print(f"![{name}]({url})\n")
11 changes: 11 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,3 +28,14 @@ jobs:
MARKDOWN_TABLE: ${{ steps.csv-table-output.outputs.markdown-table }}
run: echo "$MARKDOWN_TABLE" >> $GITHUB_STEP_SUMMARY

- run: make plots
- name: Upload plots
id: imgur
uses: devicons/[email protected]
with:
path: dist/results/plots/*.png
client_id: ${{secrets.IMGUR_CLIENT_ID}}
- name: Add plots to summary
env:
IMG_URLS: ${{ steps.imgur.outputs.imgur_urls }}
run: python .github/plot_markdown.py >> $GITHUB_STEP_SUMMARY

0 comments on commit 26755c3

Please sign in to comment.