Skip to content
Closed
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
33 changes: 33 additions & 0 deletions .github/workflows/visual-comparison.yml
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ jobs:
id: check-references
env:
GITHUB_REPOSITORY: ${{ github.repository }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
DEFAULT_BRANCH: ${{ github.base_ref }}
continue-on-error: true
run: |
Expand Down Expand Up @@ -151,6 +152,7 @@ jobs:
id: download-references
env:
GITHUB_REPOSITORY: ${{ github.repository }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
continue-on-error: true
run: |
if ./static/scripts/screenshot-artifacts.sh ./screenshots; then
Expand All @@ -160,6 +162,37 @@ jobs:
echo "⚠️ No reference screenshots found. This will create new baselines instead of comparing."
fi

- name: Debug screenshot structure
run: |
echo "Contents of ./screenshots:"
ls -la ./screenshots/ || true
echo ""
echo "First 20 files found:"
find ./screenshots -type f | head -20 || true
echo ""
echo "Directory structure:"
tree -L 3 ./screenshots/ || find ./screenshots -type d | head -20

- name: Fix screenshot directory structure
if: steps.download-references.outputs.has_references == 'true'
run: |
# The merged artifact gets extracted to ./screenshots/screenshots/
# We need to move it up one level to ./screenshots/
if [ -d "./screenshots/screenshots" ]; then
echo "Moving screenshots from nested directory..."
# Create temp directory
mkdir -p /tmp/screenshots-temp
# Move the nested content to temp
mv ./screenshots/screenshots/* /tmp/screenshots-temp/
# Remove the old structure
rm -rf ./screenshots/*
# Move back to correct location
mv /tmp/screenshots-temp/* ./screenshots/
rm -rf /tmp/screenshots-temp
echo "Screenshot structure fixed"
ls -la ./screenshots/ | head -20
fi

- name: Take screenshots with Playwright
env:
PLAYWRIGHT_SNAPSHOT_DIR: ${{ github.workspace }}/screenshots
Expand Down
Loading