Skip to content
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

Start moving the snapshots around #90

Merged
merged 4 commits into from
Sep 27, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions .github/workflows/rust.yml
Original file line number Diff line number Diff line change
Expand Up @@ -187,6 +187,10 @@ jobs:
echo "Comparing ${f/-current.png/-release.png} to $f"
npx --package=odiff-bin --yes -- odiff --parsable-stdout --threshold=0.5 "${f/-current.png/-release.png}" "$f" "${f/-current.png/-diff.png}" || true
done
- name: Save PR number
run: |
mkdir -p ./pr
echo ${{ github.event.number }} > ./visual-snapshots/PR.txt
- name: Save snapshots
uses: actions/upload-artifact@v3
with:
Expand Down
47 changes: 47 additions & 0 deletions .github/workflows/upload.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
name: Upload

on:
workflow_run:
workflows: [Rust]
types:
- completed

permissions:
checks: write
contents: read
pull-requests: write

jobs:
upload:
runs-on: ubuntu-latest
if: >
github.event.workflow_run.event == 'pull_request' &&
github.event.workflow_run.conclusion == 'success'
steps:
- uses: actions/checkout@v3
- uses: actions/download-artifact@v3
with:
name: visual-snapshots
- name: Display structure of downloaded files
run: ls -R
# - name: Upload to B2
# uses: shallwefootball/s3-upload-action@master
# id: B2
# with:
# aws_key_id: ${{ secrets.AWS_KEY_ID }}
# aws_secret_access_key: ${{ secrets.AWS_SECRET_ACCESS_KEY}}
# aws_bucket: ${{ vars.AWS_BUCKET }}
# endpoint: ${{ vars.AWS_ENDPOINT }}
# source_dir: "visual-snapshots"
# destination_dir: "30-days/${{ github.repository }}/${{ github.run_id }}"
# - name: Generate snapshots comment
# run: ./bin/snapshots-comment '${{steps.B2.outputs.object_locations}}'
# - uses: jwalton/gh-find-current-pr@v1
# id: finder
# - uses: marocchino/sticky-pull-request-comment@v2
# with:
# number: ${{ steps.finder.outputs.pr }}
# header: "Visual Snapshots"
# path: "./visual-snapshots.tmp"
# - name: Job summary (visuals)
# run: cat visual-snapshots.tmp > $GITHUB_STEP_SUMMARY