-
Notifications
You must be signed in to change notification settings - Fork 224
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
CI: Fix and simplify the dvc-diff workflow #2549
Changes from 5 commits
b7ad43b
bf5c6f6
8c88125
b34872a
befa95b
899ecbd
9591d80
4974805
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 |
---|---|---|
|
@@ -35,6 +35,12 @@ jobs: | |
- name: Pull image data from cloud storage | ||
run: dvc pull --remote upstream | ||
|
||
# workaround from https://github.com/iterative/cml/issues/1377 | ||
- name: Setup NodeJS | ||
uses: actions/setup-node@v1 | ||
with: | ||
node-version: '16' | ||
|
||
# Produce the markdown diff report, which should look like: | ||
# ## Summary of changed images | ||
# | ||
|
@@ -48,7 +54,6 @@ jobs: | |
- name: Generate the image diff report | ||
env: | ||
repo_token: ${{ secrets.GITHUB_TOKEN }} | ||
id: image-diff | ||
run: | | ||
echo -e "## Summary of changed images\n" > report.md | ||
echo -e "This is an auto-generated report of images that have changed on the DVC remote\n" >> report.md | ||
|
@@ -95,30 +100,5 @@ jobs: | |
# Mention git commit SHA in the report | ||
echo -e "Report last updated at commit ${{ github.event.pull_request.head.sha }}" >> report.md | ||
|
||
# Save the report content to the output parameter 'report' | ||
echo 'report<<EOF' >> $GITHUB_OUTPUT | ||
cat report.md >> $GITHUB_OUTPUT | ||
echo 'EOF' >> $GITHUB_OUTPUT | ||
|
||
- name: Find comment with image diff report | ||
uses: peter-evans/[email protected] | ||
id: fc | ||
with: | ||
issue-number: ${{ github.event.pull_request.number }} | ||
comment-author: 'github-actions[bot]' | ||
body-includes: 'This is an auto-generated report of images that have changed on the DVC remote' | ||
|
||
- name: Create comment with image diff report | ||
if: steps.fc.outputs.comment-id == '' | ||
uses: peter-evans/[email protected] | ||
with: | ||
issue-number: ${{ github.event.pull_request.number }} | ||
body: ${{ steps.image-diff.outputs.report }} | ||
|
||
- name: Update comment with new image diff report | ||
if: steps.fc.outputs.comment-id != '' | ||
uses: peter-evans/[email protected] | ||
with: | ||
comment-id: ${{ steps.fc.outputs.comment-id }} | ||
body: ${{ steps.image-diff.outputs.report }} | ||
edit-mode: replace | ||
# create/update PR comment | ||
cml comment update report.md | ||
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. Nice that this simplifies so many lines of code! |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
outs: | ||
- md5: 3cf01816fa5dd3fbc1adc602557bb032 | ||
size: 6187 | ||
- md5: 35388aa0ddd861e337b8f47ba4f587dc | ||
size: 7472 | ||
path: test_basemap.png |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
outs: | ||
- md5: a5aaf4c3cbea32a3373721237e767789 | ||
size: 9420 | ||
path: test_basemap_added.png |
This file was deleted.
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -11,21 +11,17 @@ def test_basemap(): | |
Create a simple basemap plot. | ||
""" | ||
fig = Figure() | ||
fig.basemap(region=[10, 70, -3, 8], projection="X8c/6c", frame="afg") | ||
fig.basemap(region=[10, 70, -3, 8], projection="X10c/6c", frame="afg") | ||
return fig | ||
|
||
|
||
@pytest.mark.mpl_image_compare | ||
def test_basemap_loglog(): | ||
def test_basemap_added(): | ||
""" | ||
Create a loglog basemap plot. | ||
Create a simple basemap plot. | ||
""" | ||
fig = Figure() | ||
fig.basemap( | ||
region=[1, 10000, 1e20, 1e25], | ||
projection="X16cl/12cl", | ||
frame=["WS", "x2+lWavelength", "ya1pf3+lPower"], | ||
) | ||
fig.basemap(region=[10, 70, -20, 20], projection="X10c/6c", frame="afg") | ||
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.
Remember to do the revert! |
||
return fig | ||
|
||
|
||
|
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.
Could update the preview a little bit below here