-
-
Notifications
You must be signed in to change notification settings - Fork 229
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
🐝 (svg tester) add GitHub action to test all possible chart views #3062
Conversation
Current dependencies on/for this PR:
This stack of pull requests is managed by Graphite. |
e9ad638
to
993efdd
Compare
7561999
to
75fafce
Compare
8859888
to
dd35855
Compare
2ebe3dc
to
8869eb9
Compare
dd35855
to
f5ee770
Compare
8869eb9
to
69d19c7
Compare
f5ee770
to
29b4749
Compare
d987a2c
to
b5e2e6d
Compare
56d8716
to
264005f
Compare
b5e2e6d
to
ecc2bce
Compare
# but only do this if we are not on master in owid-graphers (in this case we want to commit and push on master | ||
# in owid-grapher-svgs as well) | ||
- name: create owid-grapher-svgs local branch | ||
if: ${{ env.PUSH_BRANCH_NAME != 'master'}} | ||
working-directory: owid-grapher-svgs | ||
run: git branch ${{ env.PUSH_BRANCH_NAME }} && git checkout ${{ env.PUSH_BRANCH_NAME }} | ||
continue-on-error: true |
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.
If both actions commit to the same branch in owid-grapher-svgs
, then creating a branch should be a no-op if the branch already exists. git branch <b>
fails with exit code 1 if <b>
exists, that's why I set continue-on-error
to true. I wasn't sure whether the next line (the checkout) would run if the previous line failed. To be on the safe side, the branch is checked out in a separate step.
@@ -0,0 +1,88 @@ | |||
name: SVG diff (all views) | |||
on: workflow_dispatch |
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.
For now, this action can only be triggered by a click of a button on GitHub. Once it's properly tested (and I'm sure it actually gives useful feedback), I would set this to push/pull.
env: | ||
# using "ternary operator" from https://github.com/actions/runner/issues/409#issuecomment-752775072 | ||
RM_ON_ERROR: ${{ env.PUSH_BRANCH_NAME == 'master' && '' || '--rm-on-error' }} | ||
run: node --enable-source-maps itsJustJavascript/devTools/svgTester/verify-graphs.js -i owid-grapher-svgs/configs -o owid-grapher-svgs/all-views/svg -r owid-grapher-svgs/all-views/svg --ids-from-file owid-grapher-svgs/most-viewed-charts.txt --all-views $RM_ON_ERROR > compare-result |
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.
This is the only line of code that is meaningfully different compared to the other action.
2b24182
to
45a6a99
Compare
b2a8cba
to
7c77388
Compare
45a6a99
to
8129dc0
Compare
8129dc0
to
dbca493
Compare
5e617c5
to
c9f9078
Compare
dbca493
to
4fc2c94
Compare
4fc2c94
to
b06d131
Compare
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.
Looks good! Let's merge this and see if there are any issues when running manually but I'm very excited to have this soon for all commits :)
svg-compare.yml
andsvg-compare-all-views.yml
owid-grapher-svgs
most-viewed-charts.txt
file inowid-grapher-svgs
all-views/svg
most-viewed-charts.txt
text file are added to theowid-grapher-svgs
repo in Add reference SVGs for all chart views of a subset of charts owid-grapher-svgs#12act
to run actions locally, so this GitHub action is not tested in any way