Skip to content
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
14 changes: 14 additions & 0 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -303,6 +303,7 @@ jobs:
- run:
name: Compare pixels
command: .circleci/test.sh test-image ; find build -maxdepth 1 -type f -delete
- image-diff-message
- store_artifacts:
path: build
destination: /
Expand All @@ -317,6 +318,7 @@ jobs:
- run:
name: Compare pixels
command: .circleci/test.sh test-image-virtual-webgl ; find build -maxdepth 1 -type f -delete
- image-diff-message
- store_artifacts:
path: build
destination: /
Expand All @@ -331,6 +333,7 @@ jobs:
- run:
name: Compare pixels
command: .circleci/test.sh test-image ; find build -maxdepth 1 -type f -delete
- image-diff-message
- store_artifacts:
path: build
destination: /
Expand All @@ -345,6 +348,7 @@ jobs:
- run:
name: Compare pixels of mathjax v3 baselines
command: .circleci/test.sh test-image-mathjax3
- image-diff-message
- store_artifacts:
path: build
destination: /
Expand Down Expand Up @@ -515,6 +519,16 @@ jobs:
- store_artifacts:
path: topojson.tar

commands:
image-diff-message:
steps:
- run:
name: IMAGE DIFF DETECTED - SEE NOTE BELOW
when: on_fail
command: |
echo "Image Diff Detected: baseline images may need to be updated. Run 'tasks/circleci_image_artifact_download.sh' to download the baseline images generated by this job."
echo "Add the new images to 'test/image/baselines/' and commit them to this pull request."

workflows:
version: 2
build-and-test:
Expand Down
36 changes: 36 additions & 0 deletions tasks/circleci_image_artifact_download.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
#!/usr/bin/env bash

# Usage: $ ./circleci_image_artifact_download.sh JOB_NUMBER DEST_DIR

# The job number is shown on the job page in the navigation breadcrumbs under 'Job':
# ... Job
# ... > test-baselines (123456)
# It's also shown in the URL: '.../jobs/123456/...'

set -euo pipefail

# Arguments
JOB_NUMBER="${1:-}"
DEST_DIR="${2:-.}"

# Check if job number is provided
if [[ -z "$JOB_NUMBER" ]]; then
echo "CircleCI job number required. Usage: $0 <job-number> [destination-directory]"
exit 1
fi

mkdir -p "$DEST_DIR"
cd "$DEST_DIR"

# Get list of artifact URLs (filtering for .png files not containing 'diff')
artifact_urls=$(curl https://circleci.com/api/v2/project/github/plotly/plotly.js/$JOB_NUMBER/artifacts \
| grep -oE "https.*png" \
| grep -v "diff")

# Download each artifact
echo "$artifact_urls" | while read -r url; do
echo "Downloading $url..."
curl -s -L -O "$url"
done

echo "✅ All PNG artifacts saved to: $DEST_DIR"